aboutsummaryrefslogtreecommitdiff
path: root/beamer
diff options
context:
space:
mode:
authorpacien2023-10-23 21:24:11 +0200
committerpacien2023-10-23 21:24:11 +0200
commit7249325100ce5d373d7da8b3e14ea8283a56eef9 (patch)
treecb216efd8f9947881006fad2e241f39901b48a0d /beamer
parent9ba8a8702e87efce37f1d6f5d526bccde9a7a1d7 (diff)
downloadbeamer-viewer-7249325100ce5d373d7da8b3e14ea8283a56eef9.tar.gz
add button to start presentation
Instead of automatically starting after selecting a file. This pleases Chrome's popup blocker, which no longer blocks it. Firefox isn't smart enough to establish the click causality link though.
Diffstat (limited to 'beamer')
-rw-r--r--beamer/viewer/viewer.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/beamer/viewer/viewer.js b/beamer/viewer/viewer.js
index 414ff1c..065298a 100644
--- a/beamer/viewer/viewer.js
+++ b/beamer/viewer/viewer.js
@@ -21,6 +21,8 @@
21class Viewer { 21class Viewer {
22 constructor() { 22 constructor() {
23 this.fileInput = document.getElementById("fileInput"); 23 this.fileInput = document.getElementById("fileInput");
24 this.startButton = document.getElementById("startButton");
25
24 this._listenForInput(); 26 this._listenForInput();
25 } 27 }
26 28
@@ -47,8 +49,12 @@ class Viewer {
47 49
48 _listenForInput() { 50 _listenForInput() {
49 const self = this; 51 const self = this;
50 fileInput.addEventListener("change", function(event) { 52 fileInput.addEventListener("change", function(_event) {
51 self._readFile(event.target.files[0]); 53 self.startButton.disabled = false;
54 });
55
56 startButton.addEventListener("click", function(_event) {
57 self._readFile(self.fileInput.files[0]);
52 }); 58 });
53 59
54 document.body.addEventListener("drop", function(event) { 60 document.body.addEventListener("drop", function(event) {