Browse Source

Loading a new file only causes a statechange event once the whole file has loaded

n1474335 7 years ago
parent
commit
f7f07f2cb5
1 changed files with 5 additions and 4 deletions
  1. 5 4
      src/web/InputWaiter.js

+ 5 - 4
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);
 };