From 007c11f04a256a2e8704a9b26320e5c0e3457994 Mon Sep 17 00:00:00 2001 From: pacien Date: Thu, 26 Oct 2023 21:04:02 +0200 Subject: treewide: use fat arrow syntax --- beamer/viewer/stage/stage.js | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'beamer/viewer/stage/stage.js') diff --git a/beamer/viewer/stage/stage.js b/beamer/viewer/stage/stage.js index 3f1a5f5..4882c31 100644 --- a/beamer/viewer/stage/stage.js +++ b/beamer/viewer/stage/stage.js @@ -36,12 +36,11 @@ class Stage { if (this.projector == null) alert("Please allow pop-ups, then refresh this page."); - const self = this; - this.projector.addEventListener("load", function() { - self.audienceScreen = new Screen(self.projector, false, false); - self.presenterScreen = new Screen(window, true, true); - self._watchDetach(); - self.onReady(); + this.projector.addEventListener("load", () => { + this.audienceScreen = new Screen(this.projector, false, false); + this.presenterScreen = new Screen(window, true, true); + this._watchDetach(); + this.onReady(); }); this._registerEventHandler(window); @@ -56,20 +55,18 @@ class Stage { _registerEventHandler(window) { if (window == null) return; - this.eventHandlers.forEach(function(eventHandler) { - eventHandler.register(window); - }); + this.eventHandlers + .forEach(eventHandler => eventHandler.register(window)); } _watchDetach() { - const self = this; - window.addEventListener("beforeunload", function() { - self._setMessage(self.projector, "Controller detached"); - }); + window.addEventListener("beforeunload", () => + this._setMessage(this.projector, "Controller detached") + ); - this.projector.addEventListener("beforeunload", function() { - self._setMessage(window, "Viewer detached"); - }); + this.projector.addEventListener("beforeunload", () => + this._setMessage(window, "Viewer detached") + ); } _setMessage(window, message) { -- cgit v1.2.3