Skip to content
Snippets Groups Projects
Select Git revision
  • 48a213c23bf7970380e5b57802cc28541a657389
  • master default protected
  • L2SS-1914-fix_job_dispatch
  • TMSS-3170
  • TMSS-3167
  • TMSS-3161
  • TMSS-3158-Front-End-Only-Allow-Changing-Again
  • TMSS-3133
  • TMSS-3319-Fix-Templates
  • test-fix-deploy
  • TMSS-3134
  • TMSS-2872
  • defer-state
  • add-custom-monitoring-points
  • TMSS-3101-Front-End-Only
  • TMSS-984-choices
  • SDC-1400-Front-End-Only
  • TMSS-3079-PII
  • TMSS-2936
  • check-for-max-244-subbands
  • TMSS-2927---Front-End-Only-PXII
  • Before-Remove-TMSS
  • LOFAR-Release-4_4_318 protected
  • LOFAR-Release-4_4_317 protected
  • LOFAR-Release-4_4_316 protected
  • LOFAR-Release-4_4_315 protected
  • LOFAR-Release-4_4_314 protected
  • LOFAR-Release-4_4_313 protected
  • LOFAR-Release-4_4_312 protected
  • LOFAR-Release-4_4_311 protected
  • LOFAR-Release-4_4_310 protected
  • LOFAR-Release-4_4_309 protected
  • LOFAR-Release-4_4_308 protected
  • LOFAR-Release-4_4_307 protected
  • LOFAR-Release-4_4_306 protected
  • LOFAR-Release-4_4_304 protected
  • LOFAR-Release-4_4_303 protected
  • LOFAR-Release-4_4_302 protected
  • LOFAR-Release-4_4_301 protected
  • LOFAR-Release-4_4_300 protected
  • LOFAR-Release-4_4_299 protected
41 results

ganttprojectcontroller.js

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    ganttprojectcontroller.js 13.63 KiB
    // $Id: ganttprojectcontroller.js 32761 2015-11-02 11:50:21Z schaap $
    
    var ganttProjectControllerMod = angular.module('GanttProjectControllerMod', [
                                            'gantt',
                                            'gantt.sortable',
                                            'gantt.movable',
                                            'gantt.drawtask',
                                            'gantt.tooltips',
                                            'gantt.bounds',
                                            'gantt.progress',
                                            'gantt.table',
                                            'gantt.tree',
                                            'gantt.groups',
                                            'gantt.dependencies',
                                            'gantt.overlap',
                                            'gantt.resizeSensor',
                                            'gantt.contextmenu']).config(['$compileProvider', function($compileProvider) {
        $compileProvider.debugInfoEnabled(false); // Remove debug info (angularJS >= 1.3)
    }]);
    
    ganttProjectControllerMod.controller('GanttProjectController', ['$scope', 'dataService', function($scope, dataService) {
    
        var self = this;
        self.doInitialCollapse = true;
    
        $scope.dataService = dataService;
        $scope.ganttData = [];
        $scope.enabled = true;
    
        self.taskStatusColors = dataService.taskStatusColors;
        self.lastUpdateTimestamp = new Date(0);
        self.waitingForDelayedUpdate = false;
    
        $scope.options = {
            mode: 'custom',
            viewScale: '1 hours',
            currentDate: 'line',
            currentDateValue: $scope.dataService.lofarTime,
            columnMagnet: '1 minutes',
            timeFramesMagnet: false,
            sideMode: 'Table',
            autoExpand: 'both',
            taskOutOfRange: 'truncate',
            dependencies: false,
            api: function(api) {
                // API Object is used to control methods and events from angular-gantt.
                $scope.api = api;
    
                api.core.on.ready($scope, function () {
                        api.tasks.on.moveEnd($scope, moveHandler);
                        api.tasks.on.resizeEnd($scope, moveHandler);
                    }
                );
    
                api.directives.on.new($scope, function(directiveName, directiveScope, directiveElement) {
                    if (directiveName === 'ganttRow' || directiveName === 'ganttRowLabel' ) {
                        directiveElement.bind('click', function(event) {
                            if(directiveScope.row.model.project) {
                                $scope.dataService.selected_project_id = directiveScope.row.model.project.id;
                            }
                        });
                    } else if (directiveName === 'ganttTask') {
                        directiveElement.bind('click', function(event) {
                            if(directiveScope.task.model.raTask) {
                                if(event.ctrlKey) {
                                    $scope.dataService.toggleTaskSelection(directiveScope.task.model.raTask.id);
                                } else {
                                    $scope.dataService.setSelectedTaskId(directiveScope.task.model.raTask.id);
                                }
                            }