summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2020-01-27 23:24:34 +0200
committersiikamiika <siikamiika@users.noreply.github.com>2020-01-27 23:24:34 +0200
commitdd019ecf687299b0d2238312de7c476b2a263107 (patch)
tree1d52735dd3e8128cf7e74e97bc54b857ec5c5f1b /ext
parent2dbb24ea0416cb83185b6f92624bd9b6e937eade (diff)
fix audio index in resultOutputMode = 'merge'
Diffstat (limited to 'ext')
-rw-r--r--ext/mixed/js/display.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index c4be02f2..16bad3d9 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -176,7 +176,12 @@ class Display {
const entry = link.closest('.entry');
const definitionIndex = this.entryIndexFind(entry);
const expressionIndex = Display.indexOf(entry.querySelectorAll('.term-expression .action-play-audio'), link);
- this.audioPlay(this.definitions[definitionIndex], expressionIndex, definitionIndex);
+ this.audioPlay(
+ this.definitions[definitionIndex],
+ // expressionIndex is used in audioPlay to detect result output mode
+ Math.max(expressionIndex, this.options.general.resultOutputMode === 'merge' ? 0 : -1),
+ definitionIndex
+ );
}
onNoteAdd(e) {