Skip to content

Commit

Permalink
cleanup(ui): move controls container listener
Browse files Browse the repository at this point in the history
There is a note in the addEventListeners_ method that states only
fixed objects should be listened to in that method.  Other objects,
which could be recreated on configuration, should be listened to where
they are created.

This moves a listener to comply with that guideline.

Change-Id: I1c595739de976a0294007b5a904870f163f6e6cd
  • Loading branch information
joeyparrish committed Sep 30, 2020
1 parent 8f02023 commit 899f360
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ui/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,12 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
this.eventManager_.listen(this.controlsContainer_, 'click', () => {
this.onContainerClick_();
});

this.eventManager_.listen(this.controlsContainer_, 'dblclick', () => {
if (this.config_.doubleClickForFullscreen) {
this.toggleFullScreen();
}
});
}

/** @private */
Expand Down Expand Up @@ -912,12 +918,6 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
// Listen for click events to dismiss the settings menus.
this.eventManager_.listen(window, 'click', () => this.hideSettingsMenus());

this.eventManager_.listen(this.controlsContainer_, 'dblclick', () => {
if (this.config_.doubleClickForFullscreen) {
this.toggleFullScreen();
}
});

this.eventManager_.listen(this.video_, 'play', () => {
this.onPlayStateChange_();
});
Expand Down

0 comments on commit 899f360

Please sign in to comment.