Improvements on positioning in the timeline when openning the app

Now the app will try to re position itself on the timeline at the last place visited with the same zoom level. This will not be possible only when it is the first time the app is usued or when the screen resolution was changed, in both cases the positionning will be at the current datetime.
This commit is contained in:
Luis Fernando Molina committed 2018-05-15 15:38:47 +02:00
1 parent 6cb6de2c00
commit 07f8795ae6
7 files changed
+211 -83

No files matched your search

+16 -1
View File
@@ -86,8 +86,21 @@ function newTimeControlPanel() {
thisObject.buttons = buttons;
let datetime = INITIAL_DATE;
var datetime = INITIAL_DATE;
/* There is a chance that we could resume the last session at the place we left it. */
let lastRun = window.localStorage.getItem('webApp.lastRun.screenResolution');
if (lastRun !== null && lastRun === browserCanvas.width + '.' + browserCanvas.height) {
let savedCurrentDatetime = window.localStorage.getItem('timeControlPanel.currentDatetime');
if (savedCurrentDatetime !== null) {
datetime = new Date(savedCurrentDatetime);
}
}
var datetimeDisplay = {
currentDatetime: datetime,
@@ -153,6 +166,8 @@ function newTimeControlPanel() {
thisObject.datetimeDisplay.currentDatetime = newDatetime;
window.localStorage.setItem('timeControlPanel.currentDatetime', newDatetime);
}