From dd019ecf687299b0d2238312de7c476b2a263107 Mon Sep 17 00:00:00 2001 From: siikamiika Date: Mon, 27 Jan 2020 23:24:34 +0200 Subject: fix audio index in resultOutputMode = 'merge' --- ext/mixed/js/display.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) { -- cgit v1.2.3