aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-10 16:43:57 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-18 14:23:34 -0400
commit5c2dff345eb9d4a25cf1022d14e28ba5925b0b10 (patch)
tree8eced528b5372267660b866547a0625b977e6b5d /ext/mixed/js
parent7eb7c88394ebb56936861b91e6b04525abb57490 (diff)
Fix button title text not updating correctly in merge mode
Diffstat (limited to 'ext/mixed/js')
-rw-r--r--ext/mixed/js/display.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 5b8d3610..d4481349 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -810,7 +810,7 @@ class Display {
info = 'Could not find audio';
}
- const button = this.audioButtonFindImage(entryIndex);
+ const button = this.audioButtonFindImage(entryIndex, expressionIndex);
if (button !== null) {
let titleDefault = button.dataset.titleDefault;
if (!titleDefault) {
@@ -909,9 +909,16 @@ class Display {
viewerButton.dataset.noteId = noteId;
}
- audioButtonFindImage(index) {
+ audioButtonFindImage(index, expressionIndex) {
const entry = this.getEntry(index);
- return entry !== null ? entry.querySelector('.action-play-audio>img') : null;
+ if (entry === null) { return null; }
+
+ const container = (
+ expressionIndex >= 0 ?
+ entry.querySelector(`.term-expression:nth-of-type(${expressionIndex + 1})`) :
+ entry
+ );
+ return container !== null ? container.querySelector('.action-play-audio>img') : null;
}
async getDefinitionsAddable(definitions, modes) {