diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2016-01-26 15:26:59 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2016-01-26 15:43:06 +0100 |
commit | 737e090890f2bb6fd0230a848ec37ece41679933 (patch) | |
tree | 92de73d823d427ced75ee9af8060f9d1dd24033f | |
parent | 79371abf00a1f6483587c08ade0a20d5d8483e85 (diff) | |
download | zalmy-737e090890f2bb6fd0230a848ec37ece41679933.tar.gz |
Scroll to the top of the page after showing the new psalm not before
-rw-r--r-- | activePage.es | 3 | ||||
-rw-r--r-- | sworker.js | 2 | ||||
-rw-r--r-- | zalmy.es | 2 |
3 files changed, 3 insertions, 4 deletions
diff --git a/activePage.es b/activePage.es index 4b211f4..897a157 100644 --- a/activePage.es +++ b/activePage.es @@ -68,9 +68,6 @@ export class ActivePage { * Displays the Losungen for the given date (or today if not defined) */ display() { - // first scroll then switch to avoid blinking of the page - window.scroll(0, 0); - var visibleElems = document.getElementsByClassName("visible"); Array.prototype.forEach.call(visibleElems, function(e) { e.classList.remove("visible"); @@ -1,4 +1,4 @@ -var version = 'v38 2016-01-20'; +var version = 'v40 2016-01-26'; var toCache = [ '/', 'activePage.js', @@ -59,6 +59,8 @@ export class Psalm extends ActivePage console.log(`psalm_id = ${psalm_id}`); document.getElementById(psalm_id).parentElement. classList.add('visible'); + + window.scroll(0, 0); } // We have to override activePage’s next() and prev() methods to call |