From b1161cee7cb0599c64fd85528d74e664329a4286 Mon Sep 17 00:00:00 2001 From: pacien Date: Mon, 23 Oct 2023 23:40:53 +0200 Subject: startscreen: lock UI until all scripts are loaded and ready --- beamer/viewer/viewer.js | 5 +++++ index.html | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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 { this.fileReader = new FileReader(); this.presentation = null; + document.addEventListener("DOMContentLoaded", () => this._unlockUi()); this._listenForInput(); } + _unlockUi() { + this.fileInput.disabled = false; + } + _preparePresentation(source) { const self = this; pdfjsLib.getDocument(source).then(function(pdf) { diff --git a/index.html b/index.html index f92f772..7259fe9 100644 --- a/index.html +++ b/index.html @@ -70,7 +70,7 @@ demo slides.
- +