From ad313fd1825ed1b077ad9a59af9423e93032ce44 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sat, 18 Mar 2017 17:53:21 -0700 Subject: polish --- ext/mixed/img/entry-current.png | Bin 0 -> 743 bytes ext/mixed/js/display.js | 7 +++++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 ext/mixed/img/entry-current.png (limited to 'ext/mixed') diff --git a/ext/mixed/img/entry-current.png b/ext/mixed/img/entry-current.png new file mode 100644 index 00000000..bab7cc9b Binary files /dev/null and b/ext/mixed/img/entry-current.png differ 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; -- cgit v1.2.3