diff options
author | Alex Yatskov <alex@foosoft.net> | 2017-03-18 17:53:21 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2017-03-18 17:53:21 -0700 |
commit | ad313fd1825ed1b077ad9a59af9423e93032ce44 (patch) | |
tree | 8c72d5db8b42389fdb829eb8919f144bbf2f7a17 | |
parent | ad17b0603bfcbb6be54fd4941b6a7ca4195947fc (diff) |
polish
-rw-r--r-- | ext/bg/js/templates.js | 4 | ||||
-rw-r--r-- | ext/mixed/img/entry-current.png | bin | 0 -> 743 bytes | |||
-rw-r--r-- | ext/mixed/js/display.js | 7 | ||||
-rw-r--r-- | tmpl/kanji.html | 1 | ||||
-rw-r--r-- | tmpl/terms.html | 1 |
5 files changed, 9 insertions, 4 deletions
diff --git a/ext/bg/js/templates.js b/ext/bg/js/templates.js index 91518e84..333147ba 100644 --- a/ext/bg/js/templates.js +++ b/ext/bg/js/templates.js @@ -284,7 +284,7 @@ templates['fields.html'] = template({"1":function(container,depth0,helpers,parti templates['kanji.html'] = template({"1":function(container,depth0,helpers,partials,data) { var stack1, helper, alias1=depth0 != null ? depth0 : {}; - return "<div class=\"entry\">\n <div class=\"actions\">\n" + return "<div class=\"entry\">\n <div class=\"actions\">\n <img src=\"/mixed/img/entry-current.png\" title=\"Current entry\" class=\"current\" alt>\n" + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.addable : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.source : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + " </div>\n\n <div class=\"glyph\">" @@ -442,7 +442,7 @@ templates['terms.html'] = template({"1":function(container,depth0,helpers,partia },"12":function(container,depth0,helpers,partials,data) { var stack1, alias1=depth0 != null ? depth0 : {}; - return "<div class=\"entry\">\n <div class=\"actions\">\n" + return "<div class=\"entry\">\n <div class=\"actions\">\n <img src=\"/mixed/img/entry-current.png\" title=\"Current entry (arrows / home / end)\" class=\"current\" alt>\n" + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.addable : depth0),{"name":"if","hash":{},"fn":container.program(13, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.playback : depth0),{"name":"if","hash":{},"fn":container.program(15, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + " </div>\n\n" diff --git a/ext/mixed/img/entry-current.png b/ext/mixed/img/entry-current.png Binary files differnew file mode 100644 index 00000000..bab7cc9b --- /dev/null +++ b/ext/mixed/img/entry-current.png 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; diff --git a/tmpl/kanji.html b/tmpl/kanji.html index 4bb524cf..3cc7f966 100644 --- a/tmpl/kanji.html +++ b/tmpl/kanji.html @@ -1,6 +1,7 @@ {{#*inline "kanji"}} <div class="entry"> <div class="actions"> + <img src="/mixed/img/entry-current.png" title="Current entry" class="current" alt> {{#if addable}} <a href="#" title="Add Kanji" class="action-add-note pending disabled" data-mode="kanji"><img src="/mixed/img/add-kanji.png" alt></a> {{/if}} diff --git a/tmpl/terms.html b/tmpl/terms.html index fa32cea1..6212cb21 100644 --- a/tmpl/terms.html +++ b/tmpl/terms.html @@ -20,6 +20,7 @@ {{#*inline "term"}} <div class="entry"> <div class="actions"> + <img src="/mixed/img/entry-current.png" title="Current entry (arrows / home / end)" class="current" alt> {{#if addable}} <a href="#" title="Add expression" class="action-add-note pending disabled" data-mode="term-kanji"><img src="/mixed/img/add-term-kanji.png" alt></a> <a href="#" title="Add reading" class="action-add-note pending disabled" data-mode="term-kana"><img src="/mixed/img/add-term-kana.png" alt></a> |