summaryrefslogtreecommitdiff
path: root/ext/mixed/js/display.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-03-18 17:53:21 -0700
committerAlex Yatskov <alex@foosoft.net>2017-03-18 17:53:21 -0700
commitad313fd1825ed1b077ad9a59af9423e93032ce44 (patch)
tree8c72d5db8b42389fdb829eb8919f144bbf2f7a17 /ext/mixed/js/display.js
parentad17b0603bfcbb6be54fd4941b6a7ca4195947fc (diff)
polish
Diffstat (limited to 'ext/mixed/js/display.js')
-rw-r--r--ext/mixed/js/display.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 11df7208..7b8f0aae 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -167,13 +167,16 @@ class Display {
return;
}
+ $('.current').hide().eq(index).show();
+
const body = $('body').stop();
const entry = $('.entry').eq(index);
+ const target = index === 0 ? 0 : entry.offset().top;
if (smooth) {
- body.animate({scrollTop: entry.offset().top}, 200);
+ body.animate({scrollTop: target}, 200);
} else {
- body.scrollTop(entry.offset().top);
+ body.scrollTop(target);
}
this.index = index;