OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/app/assets/javascripts/angular/directives/components/slide-toggle.js

20 lines
425 B

angular.module('openproject.uiComponents')
.directive('slideToggle', [function() {
return {
restrict: 'A',
scope: {
speed: '@',
collapsed: '='
},
link: function(scope, element) {
var defaultSpeed = 'fast';
scope.$watch('collapsed', function(state, formerState) {
if (state !== formerState) element.slideToggle(scope.speed || defaultSpeed, null);
});
}
};
}]);