diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-04-10 16:43:57 -0400 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-04-18 14:23:34 -0400 |
commit | 5c2dff345eb9d4a25cf1022d14e28ba5925b0b10 (patch) | |
tree | 8eced528b5372267660b866547a0625b977e6b5d | |
parent | 7eb7c88394ebb56936861b91e6b04525abb57490 (diff) |
Fix button title text not updating correctly in merge mode
-rw-r--r-- | ext/mixed/js/display.js | 13 |
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) { |