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/controllers/timelines_controller.js

40 lines
1.4 KiB

timelinesApp.controller('TimelinesController', ['$scope', '$window', 'TimelineService', function($scope, $window, TimelineService){
$scope.switchTimeline = function() {
$window.location.href = $scope.timelines[$scope.currentTimelineId].path;
};
// Setup
$scope.slider = null;
$scope.timelineContainerNo = 1;
$scope.currentOutlineLevel = 'level3';
$scope.currentScale = 'monthly';
// Get server-side stuff into scope
$scope.currentTimelineId = gon.current_timeline_id;
$scope.timelines = gon.timelines;
$scope.timelineOptions = angular.extend(gon.timeline_options, { i18n: gon.timeline_translations });
// Get timelines stuff into scope
$scope.Timeline = Timeline;
// Container for timeline rendering
$scope.getTimelineContainerElementId = function() {
return 'timeline-container-' + $scope.timelineContainerNo;
};
$scope.getTimelineContainer = function() {
return angular.element(document.querySelector('#' + $scope.getTimelineContainerElementId()));
};
// Load timeline
$scope.timeline = TimelineService.createTimeline($scope.timelineOptions);
// $scope.timeline.load($scope.timelineOptions);
angular.element(document).ready(function() {
// start timeline
// $scope.timeline.draw($scope.getTimelineContainer());
$scope.timeline = TimelineService.startTimeline($scope.timelineOptions, $scope.getTimelineContainer());
});
}]);