diff --git a/app/assets/javascripts/angular/controllers/timelines-controller.js b/app/assets/javascripts/angular/controllers/timelines-controller.js index 36039d7e50..0e9af3bb27 100644 --- a/app/assets/javascripts/angular/controllers/timelines-controller.js +++ b/app/assets/javascripts/angular/controllers/timelines-controller.js @@ -36,4 +36,5 @@ angular.module('openproject.timelines.controllers') // Count timeline containers $scope.timelineContainerCount = 0; + }]); diff --git a/app/assets/javascripts/angular/directives/timelines/timeline-table-container-directive.js b/app/assets/javascripts/angular/directives/timelines/timeline-table-container-directive.js index fdfe8a738f..06e7f45289 100644 --- a/app/assets/javascripts/angular/directives/timelines/timeline-table-container-directive.js +++ b/app/assets/javascripts/angular/directives/timelines/timeline-table-container-directive.js @@ -36,6 +36,13 @@ angular.module('openproject.timelines.directives') replace: true, templateUrl: '/templates/timelines/timeline_table_container.html', link: function(scope, element, attributes) { + + function showWarning() { + scope.underConstruction = false; + scope.warning = true; + scope.$apply(); + } + function fetchData() { return TimelineLoaderService.loadTimelineData(scope.timeline); } @@ -81,12 +88,6 @@ angular.module('openproject.timelines.directives') }); } - function showWarning() { - scope.underConstruction = false; - scope.warning = true; - scope.$apply(); - } - function buildWorkPackageTable(timeline){ timeline.lefthandTree = null; // reset cached data tree @@ -115,7 +116,7 @@ angular.module('openproject.timelines.directives') if (scope.rows.length > 0) { completeUI(); } else { - timeline.warn(I18n.t('js.label_no_data'), 'warning', this.showWarning); + timeline.warn(I18n.t('js.label_no_data'), 'warning', showWarning); } } catch (e) { timeline.die(e);