aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pointless/viewer/stage.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/pointless/viewer/stage.js b/pointless/viewer/stage.js
index 68fdb45..7995de6 100644
--- a/pointless/viewer/stage.js
+++ b/pointless/viewer/stage.js
@@ -19,6 +19,7 @@ class Stage {
19 this.projector.addEventListener("load", function() { 19 this.projector.addEventListener("load", function() {
20 self.audienceScreen = new Screen(self.projector, false, false); 20 self.audienceScreen = new Screen(self.projector, false, false);
21 self.presenterScreen = new Screen(window, true, true); 21 self.presenterScreen = new Screen(window, true, true);
22 self._watchDetach();
22 onReady(); 23 onReady();
23 }); 24 });
24 25
@@ -51,4 +52,17 @@ class Stage {
51 return this.onPrevious(); 52 return this.onPrevious();
52 } 53 }
53 } 54 }
55
56 _watchDetach() {
57 var self = this;
58 window.addEventListener("beforeunload", function() {
59 var messageBar = self.projector.document.getElementById("message");
60 messageBar.textContent = "Controller detached";
61 });
62
63 this.projector.addEventListener("beforeunload", function() {
64 var messageBar = document.getElementById("message");
65 messageBar.textContent = "Viewer detached";
66 });
67 }
54} 68}