Quellcode durchsuchen

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

n1474335 vor 7 Jahren
Ursprung
Commit
f7f07f2cb5
1 geänderte Dateien mit 5 neuen und 4 gelöschten Zeilen
  1. 5 4
      src/web/InputWaiter.js

+ 5 - 4
src/web/InputWaiter.js

@@ -58,13 +58,14 @@ InputWaiter.prototype.get = function() {
  * @fires Manager#statechange
  * @fires Manager#statechange
  */
  */
 InputWaiter.prototype.set = function(input) {
 InputWaiter.prototype.set = function(input) {
+    const inputText = document.getElementById("input-text");
     if (input instanceof File) {
     if (input instanceof File) {
         this.setFile(input);
         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);
 };
 };