From 7b9ad61352dcb7ebaf8f3c5e5b2adeb32e14fae1 Mon Sep 17 00:00:00 2001 From: siikamiika Date: Sun, 8 Oct 2017 03:37:28 +0300 Subject: [PATCH] merged mode: fix regression (voice), tweak hover MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Alt+P now works again in grouped/split mode In merged mode, 「、」 is added even after the last term, but it's hidden for that. This ensures consistent behavior with voice button and tags --- ext/bg/js/templates.js | 8 ++++---- ext/mixed/css/display.css | 4 ++++ ext/mixed/js/display.js | 4 ++-- tmpl/terms.html | 4 ++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ext/bg/js/templates.js b/ext/bg/js/templates.js index 01507e1c..a89fdbb5 100644 --- a/ext/bg/js/templates.js +++ b/ext/bg/js/templates.js @@ -305,9 +305,9 @@ templates['terms.html'] = template({"1":function(container,depth0,helpers,partia return buffer + "
" + ((stack1 = helpers["if"].call(alias1,(depths[1] != null ? depths[1].playback : depths[1]),{"name":"if","hash":{},"fn":container.program(27, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.tags : depth0),{"name":"if","hash":{},"fn":container.program(29, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
" - + ((stack1 = helpers.unless.call(alias1,(data && data.last),{"name":"unless","hash":{},"fn":container.program(32, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\n \n"; + + "\n"; },"24":function(container,depth0,helpers,partials,data) { var stack1, helper, options; @@ -337,7 +337,7 @@ templates['terms.html'] = template({"1":function(container,depth0,helpers,partia + alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper))) + "\n"; },"32":function(container,depth0,helpers,partials,data) { - return "、"; + return "invisible"; },"34":function(container,depth0,helpers,partials,data) { var stack1, helper, options, buffer = "
"; diff --git a/ext/mixed/css/display.css b/ext/mixed/css/display.css index 147256bf..fe2f6bbe 100644 --- a/ext/mixed/css/display.css +++ b/ext/mixed/css/display.css @@ -46,6 +46,10 @@ hr { display: none; } +.invisible { + visibility: hidden; +} + /* * Entries diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index e54c8b18..a335c694 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -73,7 +73,7 @@ class Display { e.preventDefault(); const link = $(e.currentTarget); const definitionIndex = Display.entryIndexFind(link); - const expressionIndex = $(e.currentTarget).closest('.entry').find('.expression .action-play-audio').index(link); + const expressionIndex = link.closest('.entry').find('.expression .action-play-audio').index(link); this.audioPlay(this.definitions[definitionIndex], expressionIndex); } @@ -185,7 +185,7 @@ class Display { 80: /* p */ () => { if (e.altKey) { if ($('.entry').eq(this.index).data('type') === 'term') { - this.audioPlay(this.definitions[this.index]); + this.audioPlay(this.definitions[this.index], -1); } return true; diff --git a/tmpl/terms.html b/tmpl/terms.html index 40a44c12..b1f080a2 100644 --- a/tmpl/terms.html +++ b/tmpl/terms.html @@ -57,8 +57,8 @@ {{/if}}
{{~#unless @last~}}、{{/unless}} - + --> {{/each}} {{else}}
{{#kanjiLinks}}{{#furigana}}{{{.}}}{{/furigana}}{{/kanjiLinks}}