From 16d20eabd2d61c8af245b7a219781cf9182e930d Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Tue, 24 May 2016 12:33:47 -0700 Subject: [PATCH] [Timeline] Simplify method --- .../src/controllers/TimelineZoomController.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/platform/features/timeline/src/controllers/TimelineZoomController.js b/platform/features/timeline/src/controllers/TimelineZoomController.js index 1c21cbfe8c..7bd64eb408 100644 --- a/platform/features/timeline/src/controllers/TimelineZoomController.js +++ b/platform/features/timeline/src/controllers/TimelineZoomController.js @@ -72,9 +72,9 @@ define( bounds.x = toPixels(timespan.getStart()); } - function initializeZoom(domainObject) { - if (domainObject) { - domainObject.useCapability('timespan') + function initializeZoom() { + if ($scope.domainObject) { + $scope.domainObject.useCapability('timespan') .then(initializeZoomFromTimespan); } } @@ -109,11 +109,7 @@ define( * Set the zoom level to fit the bounds of the timeline * being viewed. */ - fit: function () { - if ($scope.domainObject) { - initializeZoom($scope.domainObject); - } - }, + fit: initializeZoom, /** * Get the width, in pixels, of a specific time duration at * the current zoom level.