Merge pull request #1225 from opf/fix/timelines-show-warning-7186

Moved show warning method to timelines controller.
pull/1233/head
Till Breuer 11 years ago
commit 5edd6cac6d
  1. 1
      app/assets/javascripts/angular/controllers/timelines-controller.js
  2. 15
      app/assets/javascripts/angular/directives/timelines/timeline-table-container-directive.js

@ -36,4 +36,5 @@ angular.module('openproject.timelines.controllers')
// Count timeline containers
$scope.timelineContainerCount = 0;
}]);

@ -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);

Loading…
Cancel
Save