fix audio index in resultOutputMode = 'merge'

This commit is contained in:
siikamiika 2020-01-27 23:24:34 +02:00
parent 2dbb24ea04
commit dd019ecf68

View File

@ -176,7 +176,12 @@ class Display {
const entry = link.closest('.entry'); const entry = link.closest('.entry');
const definitionIndex = this.entryIndexFind(entry); const definitionIndex = this.entryIndexFind(entry);
const expressionIndex = Display.indexOf(entry.querySelectorAll('.term-expression .action-play-audio'), link); 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) { onNoteAdd(e) {