Skip to content

Commit

Permalink
cleanup(ui): clean up extra casts and functions
Browse files Browse the repository at this point in the history
There is no need to create an extra callback to hide the overflow
menus, nor should we have to cast the elements if we give the array
the correct type in the first place.

Change-Id: I7a0f0b5a97564f6577c94aa095c7ed6c07a41cae
  • Loading branch information
joeyparrish committed Sep 30, 2020
1 parent 899f360 commit 5ebbaef
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions ui/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
/** @private {boolean} */
this.isSeeking_ = false;

/** @private {!Array.<!Element>} */
/** @private {!Array.<!HTMLElement>} */
this.settingsMenus_ = [];

/**
Expand Down Expand Up @@ -132,13 +132,8 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
* @private {shaka.util.Timer}
*/
this.hideSettingsMenusTimer_ = new shaka.util.Timer(() => {
/** @type {function(!HTMLElement)} */
const hide = (control) => {
shaka.ui.Utils.setDisplay(control, /* visible= */ false);
};

for (const menu of this.settingsMenus_) {
hide(/** @type {!HTMLElement} */ (menu));
shaka.ui.Utils.setDisplay(menu, /* visible= */ false);
}
});

Expand Down

0 comments on commit 5ebbaef

Please sign in to comment.