Merge pull request #1231 from opf/fix/timeline-updates-7247

Avoid chart duplication on timeline updates on modal.close
pull/1233/head
manwithtwowatches 11 years ago
commit 625d71012c
  1. 15
      app/assets/javascripts/angular/directives/timelines/timeline-table-container-directive.js

@ -124,11 +124,19 @@ angular.module('openproject.timelines.directives')
} }
function renderTimeline() { function renderTimeline() {
fetchData() return fetchData()
.then(buildWorkPackageTable) .then(buildWorkPackageTable)
.then(drawChart); .then(drawChart);
} }
function reloadTimeline() {
return fetchData()
.then(buildWorkPackageTable)
.then(function() {
scope.timeline.expandToOutlineLevel(scope.currentOutlineLevel); // also triggers rebuildAll()
});
}
function registerModalHelper() { function registerModalHelper() {
scope.timeline.modalHelper = modalHelperInstance; scope.timeline.modalHelper = modalHelperInstance;
@ -142,7 +150,10 @@ angular.module('openproject.timelines.directives')
); );
jQuery(scope.timeline.modalHelper).on('closed', function() { jQuery(scope.timeline.modalHelper).on('closed', function() {
renderTimeline(); // TODO remove and do updates via scope reloadTimeline().then(function() {
window.clearTimeout(scope.timeline.safetyHook);
});
// TODO remove and do updates via scope
}); });
} }

Loading…
Cancel
Save