Skip to content

Commit

Permalink
feat(UI): Hide language and resolution overflow menu button if there'…
Browse files Browse the repository at this point in the history
…s only one choice (#5928)

Closes #4720
  • Loading branch information
avelad committed Nov 27, 2023
1 parent 078ab36 commit 628bb63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ui/audio_language_selection.js
Expand Up @@ -76,6 +76,9 @@ shaka.ui.AudioLanguageSelection = class extends shaka.ui.SettingsMenu {
new shaka.util.FakeEvent('languageselectionupdated'));

this.button.setAttribute('shaka-status', this.currentSelection.innerText);

const numberOfItems = this.menu.getElementsByTagName('button').length;
shaka.ui.Utils.setDisplay(this.button, numberOfItems > 2);
}

/** @private */
Expand Down
2 changes: 2 additions & 0 deletions ui/resolution_selection.js
Expand Up @@ -194,6 +194,8 @@ shaka.ui.ResolutionSelection = class extends shaka.ui.SettingsMenu {
new shaka.util.FakeEvent('resolutionselectionupdated'));

this.updateLocalizedStrings_();

shaka.ui.Utils.setDisplay(this.button, tracks.length > 0);
}


Expand Down

0 comments on commit 628bb63

Please sign in to comment.