diff options
Diffstat (limited to 'beamer/viewer')
-rw-r--r-- | beamer/viewer/viewer.js | 10 |
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 @@ | |||
21 | class Viewer { | 21 | class 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) { |