mirror of
https://github.com/nasa/openmct.git
synced 2024-12-22 14:32:22 +00:00
[Timeline] Simplify method
This commit is contained in:
parent
eb5566f041
commit
16d20eabd2
@ -72,9 +72,9 @@ define(
|
|||||||
bounds.x = toPixels(timespan.getStart());
|
bounds.x = toPixels(timespan.getStart());
|
||||||
}
|
}
|
||||||
|
|
||||||
function initializeZoom(domainObject) {
|
function initializeZoom() {
|
||||||
if (domainObject) {
|
if ($scope.domainObject) {
|
||||||
domainObject.useCapability('timespan')
|
$scope.domainObject.useCapability('timespan')
|
||||||
.then(initializeZoomFromTimespan);
|
.then(initializeZoomFromTimespan);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -109,11 +109,7 @@ define(
|
|||||||
* Set the zoom level to fit the bounds of the timeline
|
* Set the zoom level to fit the bounds of the timeline
|
||||||
* being viewed.
|
* being viewed.
|
||||||
*/
|
*/
|
||||||
fit: function () {
|
fit: initializeZoom,
|
||||||
if ($scope.domainObject) {
|
|
||||||
initializeZoom($scope.domainObject);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
* Get the width, in pixels, of a specific time duration at
|
* Get the width, in pixels, of a specific time duration at
|
||||||
* the current zoom level.
|
* the current zoom level.
|
||||||
|
Loading…
Reference in New Issue
Block a user