From 85432af187408be0acfea560f46e4619864bf451 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Tue, 24 May 2016 11:53:27 -0700 Subject: [PATCH] [Timeline] Don't store zoom configuration https://github.com/nasa/openmct/issues/936#issuecomment-221343620 --- .../src/controllers/TimelineZoomController.js | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/platform/features/timeline/src/controllers/TimelineZoomController.js b/platform/features/timeline/src/controllers/TimelineZoomController.js index 884904e7ba..0ba5abbb28 100644 --- a/platform/features/timeline/src/controllers/TimelineZoomController.js +++ b/platform/features/timeline/src/controllers/TimelineZoomController.js @@ -62,19 +62,6 @@ define( } } - // Persist current zoom level - function storeZoom() { - var isEditMode = $scope.commit && - $scope.domainObject && - $scope.domainObject.hasCapability('editor') && - $scope.domainObject.getCapability('editor').inEditContext(); - if (isEditMode) { - $scope.configuration = $scope.configuration || {}; - $scope.configuration.zoomLevel = zoomIndex; - $scope.commit(); - } - } - function initializeZoomFromTimespan(timespan) { var duration = timespan.getDuration(); zoomIndex = 0; @@ -96,7 +83,6 @@ define( bounds = scroll; }); $scope.$watch("domainObject", initializeZoom); - $scope.$watch("configuration.zoomLevel", setZoomLevel); return { /** @@ -115,15 +101,17 @@ define( if (arguments.length > 0 && !isNaN(amount)) { var center = this.toMillis(bounds.x + bounds.width / 2); setZoomLevel(zoomIndex + amount); - storeZoom(zoomIndex); bounds.x = this.toPixels(center) - bounds.width / 2; } return zoomLevels[zoomIndex]; }, + /** + * Set the zoom level to fit the bounds of the timeline + * being viewed. + */ fit: function () { if ($scope.domainObject) { initializeZoom($scope.domainObject); - storeZoom(); } }, /**