From 737e090890f2bb6fd0230a848ec37ece41679933 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Tue, 26 Jan 2016 15:26:59 +0100 Subject: Scroll to the top of the page after showing the new psalm not before --- activePage.es | 3 --- sworker.js | 2 +- 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"); diff --git a/sworker.js b/sworker.js index 73b777b..869a1f0 100644 --- a/sworker.js +++ b/sworker.js @@ -1,4 +1,4 @@ -var version = 'v38 2016-01-20'; +var version = 'v40 2016-01-26'; var toCache = [ '/', 'activePage.js', diff --git a/zalmy.es b/zalmy.es index 3cffae4..b5834d8 100644 --- a/zalmy.es +++ b/zalmy.es @@ -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 -- cgit