diff options
author | Simon Rettberg | 2022-12-02 15:21:47 +0100 |
---|---|---|
committer | Simon Rettberg | 2022-12-02 15:24:08 +0100 |
commit | d4fcb0d76aef5613e094aba3ee8ee29ce615f7be (patch) | |
tree | f640a133c6623df095bf6696d50d7b31d19c8377 /modules-available/locationinfo/templates | |
parent | [statistics] Per-location usage stats; include active lecture count (diff) | |
download | slx-admin-d4fcb0d76aef5613e094aba3ee8ee29ce615f7be.tar.gz slx-admin-d4fcb0d76aef5613e094aba3ee8ee29ce615f7be.tar.xz slx-admin-d4fcb0d76aef5613e094aba3ee8ee29ce615f7be.zip |
[locationinfo] Workaround calendar scrolling to wrong day
Diffstat (limited to 'modules-available/locationinfo/templates')
-rwxr-xr-x | modules-available/locationinfo/templates/frontend-default.html | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/modules-available/locationinfo/templates/frontend-default.html b/modules-available/locationinfo/templates/frontend-default.html index 6e04550d..cc62075e 100755 --- a/modules-available/locationinfo/templates/frontend-default.html +++ b/modules-available/locationinfo/templates/frontend-default.html @@ -564,6 +564,8 @@ optional: putInRange(config, 'rotation', 0, 3, 0); } + var updateTimer = null; + /** * generates the Room divs and calls the needed functions depending on the rooms mode */ @@ -651,7 +653,7 @@ optional: } mainUpdateLoop(); - setInterval(mainUpdateLoop, 10000); + updateTimer = setInterval(mainUpdateLoop, 10000); setInterval(updateHeaders, globalConfig.eco ? 10000 : 1000); } @@ -679,7 +681,14 @@ optional: var today = date.getDate(); if (lastDate !== false) { if (lastDate !== today) { - location.reload(true); + if (updateTimer !== null) { + clearInterval(updateTimer); + updateTimer = null; + } + // Delay by a minute, sometimes the calendar shows the previous day if we load too quickly. + setTimeout(function() { + location.reload(true); + }, 60000); } } else { lastDate = today; @@ -1326,7 +1335,6 @@ optional: /========================================== Room Layout ============================================= */ - const picSizeX = 3.8; const picSizeY = 3; |