Commit c85685e9 authored by Nick Stenning's avatar Nick Stenning

Remove unneeded ui-bootstrap shim

This shim was used to facilitate the use of a newer version of the
'ui.bootstrap' module with an older version of Angular. Upgrading to
Angular 1.4 renders it surplus to requirements.
parent a47bcb6a
...@@ -93,7 +93,7 @@ module.exports = angular.module('h', [ ...@@ -93,7 +93,7 @@ module.exports = angular.module('h', [
'ngTagsInput' 'ngTagsInput'
'ngWebSocket' 'ngWebSocket'
'toastr' 'toastr'
require('./ui-bootstrap-custom') 'ui.bootstrap'
]) ])
.controller('AppController', require('./app-controller')) .controller('AppController', require('./app-controller'))
......
// this module is a wrapper around the 'ui.bootstrap' module which
// provides shims/stubs needed to use a current custom build of
// UI Bootstrap (which otherwise requires Angular 1.3.x) with Angular 1.2.x
//
// When/if the app is upgraded to Angular 1.3.x this module can
// just be removed.
var Promise = require('core-js/library/es6/promise');
module.exports = 'ui.bootstrap';
// import the upstream build of UI Bootstrap which defines the
// 'ui.bootstrap' module and sub-modules for the components we are using
require('./vendor/ui-bootstrap-custom-tpls-0.13.4');
angular.module('ui.bootstrap')
// stub implementation of $templateRequest, which is used
// by optional features that we are not using in the dropdown menu directive
.factory('$templateRequest', function() {
return function () {
throw new Error('$templateRequest service is not implemented');
}
})
.config(function ($provide) {
// wrap the $animate service's addClass() and removeClass() functions
// to return a Promise (as in Angular 1.3.x) instead of taking a done()
// callback as the last argument (as in Angular 1.2.x)
$provide.decorator('$animate', function($delegate) {
return angular.extend({}, $delegate, {
addClass: function (element, className) {
return new Promise(function (resolve) {
$delegate.addClass(element, className, resolve)
});
},
removeClass: function (element, className) {
return new Promise(function (resolve) {
$delegate.removeClass(element, className, resolve);
});
}
});
});
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment