merged mode: fix regression (voice), tweak hover

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
This commit is contained in:
siikamiika 2017-10-08 03:37:28 +03:00
parent 94d590fc85
commit 7b9ad61352
4 changed files with 12 additions and 8 deletions

View File

@ -305,9 +305,9 @@ templates['terms.html'] = template({"1":function(container,depth0,helpers,partia
return buffer + "</span><!--\n --><div class=\"peek-wrapper\">" return buffer + "</span><!--\n --><div class=\"peek-wrapper\">"
+ ((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,(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["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 : "")
+ "<!--\n --><span style=\"display: inline-block;\"></span><!--\n --></div><!--\n -->" + "<!--\n --><span style=\"display: inline-block;\"></span><!--\n --></div><!--\n --><span class=\""
+ ((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 : "") + ((stack1 = helpers["if"].call(alias1,(data && data.last),{"name":"if","hash":{},"fn":container.program(32, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\n </div>\n"; + "\">、</span><!--\n --></div>\n";
},"24":function(container,depth0,helpers,partials,data) { },"24":function(container,depth0,helpers,partials,data) {
var stack1, helper, options; 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))) + 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)))
+ "</span>\n"; + "</span>\n";
},"32":function(container,depth0,helpers,partials,data) { },"32":function(container,depth0,helpers,partials,data) {
return ""; return "invisible";
},"34":function(container,depth0,helpers,partials,data) { },"34":function(container,depth0,helpers,partials,data) {
var stack1, helper, options, buffer = var stack1, helper, options, buffer =
" <div class=\"expression\">"; " <div class=\"expression\">";

View File

@ -46,6 +46,10 @@ hr {
display: none; display: none;
} }
.invisible {
visibility: hidden;
}
/* /*
* Entries * Entries

View File

@ -73,7 +73,7 @@ class Display {
e.preventDefault(); e.preventDefault();
const link = $(e.currentTarget); const link = $(e.currentTarget);
const definitionIndex = Display.entryIndexFind(link); 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); this.audioPlay(this.definitions[definitionIndex], expressionIndex);
} }
@ -185,7 +185,7 @@ class Display {
80: /* p */ () => { 80: /* p */ () => {
if (e.altKey) { if (e.altKey) {
if ($('.entry').eq(this.index).data('type') === 'term') { if ($('.entry').eq(this.index).data('type') === 'term') {
this.audioPlay(this.definitions[this.index]); this.audioPlay(this.definitions[this.index], -1);
} }
return true; return true;

View File

@ -57,8 +57,8 @@
{{/if}}<!-- {{/if}}<!--
--><span style="display: inline-block;"></span><!-- --><span style="display: inline-block;"></span><!--
--></div><!-- --></div><!--
-->{{~#unless @last~}}、{{/unless}} --><span class="{{#if @last}}invisible{{/if}}"></span><!--
</div> --></div>
{{/each}} {{/each}}
{{else}} {{else}}
<div class="expression">{{#kanjiLinks}}{{#furigana}}{{{.}}}{{/furigana}}{{/kanjiLinks}}</div> <div class="expression">{{#kanjiLinks}}{{#furigana}}{{{.}}}{{/furigana}}{{/kanjiLinks}}</div>