aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--beamer/viewer/viewer.js10
-rw-r--r--index.html3
2 files changed, 11 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) {
diff --git a/index.html b/index.html
index 68239ff..61c53fc 100644
--- a/index.html
+++ b/index.html
@@ -70,6 +70,9 @@
70 </p> 70 </p>
71 71
72 <input id="fileInput" type="file" multiple="false" accept="application/pdf" /> 72 <input id="fileInput" type="file" multiple="false" accept="application/pdf" />
73 <br />
74 <br />
75 <input id="startButton" type="button" value="Start presentation" disabled />
73 </div> 76 </div>
74 </div> 77 </div>
75 78