mirror of
https://github.com/nasa/openmct.git
synced 2025-01-03 03:46:42 +00:00
[Timeline] Don't store zoom configuration
https://github.com/nasa/openmct/issues/936#issuecomment-221343620
This commit is contained in:
parent
9a5209f7c2
commit
85432af187
@ -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) {
|
function initializeZoomFromTimespan(timespan) {
|
||||||
var duration = timespan.getDuration();
|
var duration = timespan.getDuration();
|
||||||
zoomIndex = 0;
|
zoomIndex = 0;
|
||||||
@ -96,7 +83,6 @@ define(
|
|||||||
bounds = scroll;
|
bounds = scroll;
|
||||||
});
|
});
|
||||||
$scope.$watch("domainObject", initializeZoom);
|
$scope.$watch("domainObject", initializeZoom);
|
||||||
$scope.$watch("configuration.zoomLevel", setZoomLevel);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
/**
|
/**
|
||||||
@ -115,15 +101,17 @@ define(
|
|||||||
if (arguments.length > 0 && !isNaN(amount)) {
|
if (arguments.length > 0 && !isNaN(amount)) {
|
||||||
var center = this.toMillis(bounds.x + bounds.width / 2);
|
var center = this.toMillis(bounds.x + bounds.width / 2);
|
||||||
setZoomLevel(zoomIndex + amount);
|
setZoomLevel(zoomIndex + amount);
|
||||||
storeZoom(zoomIndex);
|
|
||||||
bounds.x = this.toPixels(center) - bounds.width / 2;
|
bounds.x = this.toPixels(center) - bounds.width / 2;
|
||||||
}
|
}
|
||||||
return zoomLevels[zoomIndex];
|
return zoomLevels[zoomIndex];
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Set the zoom level to fit the bounds of the timeline
|
||||||
|
* being viewed.
|
||||||
|
*/
|
||||||
fit: function () {
|
fit: function () {
|
||||||
if ($scope.domainObject) {
|
if ($scope.domainObject) {
|
||||||
initializeZoom($scope.domainObject);
|
initializeZoom($scope.domainObject);
|
||||||
storeZoom();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user