From f7f07f2cb55dad6dfa35bb889c24d46023eee484 Mon Sep 17 00:00:00 2001 From: n1474335 Date: Wed, 27 Dec 2017 15:52:38 +0000 Subject: [PATCH] Loading a new file only causes a statechange event once the whole file has loaded --- src/web/InputWaiter.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/web/InputWaiter.js b/src/web/InputWaiter.js index f6818b11..af5ed81f 100755 --- a/src/web/InputWaiter.js +++ b/src/web/InputWaiter.js @@ -58,13 +58,14 @@ InputWaiter.prototype.get = function() { * @fires Manager#statechange */ InputWaiter.prototype.set = function(input) { + const inputText = document.getElementById("input-text"); if (input instanceof File) { this.setFile(input); - input = ""; + inputText.value = ""; + } else { + inputText.value = input; + window.dispatchEvent(this.manager.statechange); } - - document.getElementById("input-text").value = input; - window.dispatchEvent(this.manager.statechange); };