summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2016-01-26 15:26:59 +0100
committerMatěj Cepl <mcepl@cepl.eu>2016-01-26 15:43:06 +0100
commit737e090890f2bb6fd0230a848ec37ece41679933 (patch)
tree92de73d823d427ced75ee9af8060f9d1dd24033f
parent79371abf00a1f6483587c08ade0a20d5d8483e85 (diff)
downloadzalmy-737e090890f2bb6fd0230a848ec37ece41679933.tar.gz
Scroll to the top of the page after showing the new psalm not before
-rw-r--r--activePage.es3
-rw-r--r--sworker.js2
-rw-r--r--zalmy.es2
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