mirror of
https://github.com/nasa/openmct.git
synced 2025-05-09 20:12:50 +00:00
[Timeline] Simplify scroll-setting
This commit is contained in:
parent
d52bfed1df
commit
86b31bc040
@ -33,8 +33,6 @@ define(
|
|||||||
var zoomLevels = ZOOM_CONFIGURATION.levels || [1000],
|
var zoomLevels = ZOOM_CONFIGURATION.levels || [1000],
|
||||||
zoomIndex = Math.floor(zoomLevels.length / 2),
|
zoomIndex = Math.floor(zoomLevels.length / 2),
|
||||||
tickWidth = ZOOM_CONFIGURATION.width || 200,
|
tickWidth = ZOOM_CONFIGURATION.width || 200,
|
||||||
desiredScroll = 0,
|
|
||||||
achievedDesiredScroll,
|
|
||||||
bounds = { x: 0, width: tickWidth }; // Default duration in view
|
bounds = { x: 0, width: tickWidth }; // Default duration in view
|
||||||
|
|
||||||
function toMillis(pixels) {
|
function toMillis(pixels) {
|
||||||
@ -57,11 +55,8 @@ define(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setScroll(x) {
|
function setScroll(x) {
|
||||||
desiredScroll = x;
|
|
||||||
achievedDesiredScroll = false;
|
|
||||||
$timeout(function () {
|
$timeout(function () {
|
||||||
$scope.scroll.x = desiredScroll;
|
$scope.scroll.x = x;
|
||||||
achievedDesiredScroll = true;
|
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user