Disable the audio button when no sources are enabled (#1003)

This commit is contained in:
toasted-nutbread 2020-11-07 12:03:10 -05:00 committed by GitHub
parent 7fa4782954
commit be952a1857
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -722,7 +722,7 @@ class Display extends EventDispatcher {
_updateDocumentOptions(options) { _updateDocumentOptions(options) {
const data = document.documentElement.dataset; const data = document.documentElement.dataset;
data.ankiEnabled = `${options.anki.enable}`; data.ankiEnabled = `${options.anki.enable}`;
data.audioEnabled = `${options.audio.enabled}`; data.audioEnabled = `${options.audio.enabled && options.audio.sources.length > 0}`;
data.compactGlossaries = `${options.general.compactGlossaries}`; data.compactGlossaries = `${options.general.compactGlossaries}`;
data.enableSearchTags = `${options.scanning.enableSearchTags}`; data.enableSearchTags = `${options.scanning.enableSearchTags}`;
data.showPitchAccentDownstepNotation = `${options.general.showPitchAccentDownstepNotation}`; data.showPitchAccentDownstepNotation = `${options.general.showPitchAccentDownstepNotation}`;