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/timelines/timeline-container-directiv...

32 lines
970 B

angular.module('openproject.timelines.directives')
.directive('timelineContainer', [function() {
getInitialOutlineExpansion = function(timelineOptions) {
initialOutlineExpansion = timelineOptions.initial_outline_expansion;
if (initialOutlineExpansion && initialOutlineExpansion >= 0) {
return initialOutlineExpansion;
} else {
return 0;
}
};
return {
restrict: 'E',
replace: true,
transclude: true,
template: '<div ng-transclude id="{{timelineContainerElementId}}"/>',
link: function(scope) {
scope.timelineContainerElementId = 'timeline-container-' + (++scope.timelineContainerCount);
// Hide charts until tables are drawn
scope.underConstruction = true;
// Create timeline object
scope.timeline = Timeline.create(scope.timelineOptions);
// Set initial expansion index
scope.timeline.expansionIndex = getInitialOutlineExpansion(scope.timelineOptions);
}
};
}]);