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

21 lines
468 B

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