Fix Text-to-speech voice dropdown being reset

This commit is contained in:
toasted-nutbread 2019-12-11 21:15:51 -05:00
parent 47feb95842
commit 7446c99f98

View File

@ -38,6 +38,7 @@ function textToSpeechInitialize() {
speechSynthesis.addEventListener('voiceschanged', () => updateTextToSpeechVoices(), false);
updateTextToSpeechVoices();
document.querySelector('#text-to-speech-voice').addEventListener('change', (e) => onTextToSpeechVoiceChange(e), false);
document.querySelector('#text-to-speech-voice-test').addEventListener('click', () => textToSpeechTest(), false);
}
@ -111,3 +112,7 @@ function textToSpeechTest() {
// NOP
}
}
function onTextToSpeechVoiceChange(e) {
e.currentTarget.dataset.value = e.currentTarget.value;
}