diff --git a/bigbluebutton-html5/imports/ui/components/nav-bar/settings-dropdown/container.jsx b/bigbluebutton-html5/imports/ui/components/nav-bar/settings-dropdown/container.jsx
index bcf5b317eb..c19c5bc7ae 100755
--- a/bigbluebutton-html5/imports/ui/components/nav-bar/settings-dropdown/container.jsx
+++ b/bigbluebutton-html5/imports/ui/components/nav-bar/settings-dropdown/container.jsx
@@ -17,17 +17,23 @@ export default class SettingsDropdownContainer extends Component {
}
componentDidMount() {
- document.addEventListener("fullscreenchange", this.fullScreenToggleCallback);
- document.addEventListener("webkitfullscreenchange", this.fullScreenToggleCallback);
- document.addEventListener("mozfullscreenchange", this.fullScreenToggleCallback);
- document.addEventListener("MSFullscreenChange", this.fullScreenToggleCallback);
+ const fullscreenChangedEvents = ['fullscreenchange',
+ 'webkitfullscreenchange',
+ 'mozfullscreenchange',
+ 'MSFullscreenChange'];
+
+ fullscreenChangedEvents.forEach(event =>
+ document.addEventListener(event, this.fullScreenToggleCallback));
}
componentWillUnmount() {
- document.removeEventListener("fullscreenchange", this.fullScreenToggleCallback);
- document.removeEventListener("webkitfullscreenchange", this.fullScreenToggleCallback);
- document.removeEventListener("mozfullscreenchange", this.fullScreenToggleCallback);
- document.removeEventListener("MSFullscreenChange", this.fullScreenToggleCallback);
+ const fullscreenChangedEvents = ['fullscreenchange',
+ 'webkitfullscreenchange',
+ 'mozfullscreenchange',
+ 'MSFullscreenChange'];
+
+ fullscreenChangedEvents.forEach(event =>
+ document.removeEventListener(event, this.fullScreenToggleCallback));
}
fullScreenToggleCallback() {