diff --git a/platform/features/timeline/res/templates/timeline.html b/platform/features/timeline/res/templates/timeline.html index fc2e779a36..8dc145b7f0 100644 --- a/platform/features/timeline/res/templates/timeline.html +++ b/platform/features/timeline/res/templates/timeline.html @@ -103,6 +103,13 @@
+ + I + + 0 && !isNaN(amount)) { var center = this.toMillis(bounds.x + bounds.width / 2); @@ -90,22 +120,24 @@ define( } return zoomLevels[zoomIndex]; }, + fit: function () { + if ($scope.domainObject) { + initializeZoom($scope.domainObject); + storeZoom(); + } + }, /** * Get the width, in pixels, of a specific time duration at * the current zoom level. * @returns {number} the number of pixels */ - toPixels: function (millis) { - return tickWidth * millis / zoomLevels[zoomIndex]; - }, + toPixels: toPixels, /** * Get the time duration, in milliseconds, occupied by the * width (specified in pixels) at the current zoom level. * @returns {number} the number of pixels */ - toMillis: function (pixels) { - return (pixels / tickWidth) * zoomLevels[zoomIndex]; - }, + toMillis: toMillis, /** * Get or set the current displayed duration. If used as a * setter, this will typically be rounded up to ensure extra