diff options
author | pacien | 2023-10-23 23:40:53 +0200 |
---|---|---|
committer | pacien | 2023-10-23 23:40:53 +0200 |
commit | b1161cee7cb0599c64fd85528d74e664329a4286 (patch) | |
tree | 5181abd102ac9bd639088985bd7f6c40b2e51fe5 | |
parent | 0f7daaa9b59e400f77969515aec63d4dfca036d9 (diff) | |
download | beamer-viewer-b1161cee7cb0599c64fd85528d74e664329a4286.tar.gz |
startscreen: lock UI until all scripts are loaded and ready
-rw-r--r-- | beamer/viewer/viewer.js | 5 | ||||
-rw-r--r-- | index.html | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/beamer/viewer/viewer.js b/beamer/viewer/viewer.js index e9c6d65..a614c88 100644 --- a/beamer/viewer/viewer.js +++ b/beamer/viewer/viewer.js | |||
@@ -26,9 +26,14 @@ class Viewer { | |||
26 | this.fileReader = new FileReader(); | 26 | this.fileReader = new FileReader(); |
27 | this.presentation = null; | 27 | this.presentation = null; |
28 | 28 | ||
29 | document.addEventListener("DOMContentLoaded", () => this._unlockUi()); | ||
29 | this._listenForInput(); | 30 | this._listenForInput(); |
30 | } | 31 | } |
31 | 32 | ||
33 | _unlockUi() { | ||
34 | this.fileInput.disabled = false; | ||
35 | } | ||
36 | |||
32 | _preparePresentation(source) { | 37 | _preparePresentation(source) { |
33 | const self = this; | 38 | const self = this; |
34 | pdfjsLib.getDocument(source).then(function(pdf) { | 39 | pdfjsLib.getDocument(source).then(function(pdf) { |
@@ -70,7 +70,7 @@ | |||
70 | <a href="#file=sample/demo.pdf" onclick="load('sample/demo.pdf')">demo slides</a>. | 70 | <a href="#file=sample/demo.pdf" onclick="load('sample/demo.pdf')">demo slides</a>. |
71 | </p> | 71 | </p> |
72 | 72 | ||
73 | <input id="fileInput" type="file" multiple="false" accept="application/pdf" /> | 73 | <input id="fileInput" type="file" multiple="false" accept="application/pdf" disabled /> |
74 | <br /> | 74 | <br /> |
75 | <br /> | 75 | <br /> |
76 | <input id="startButton" type="button" value="Start presentation" disabled /> | 76 | <input id="startButton" type="button" value="Start presentation" disabled /> |