Drop upload from browser downloads fixed
authorVásáry Dániel <vasary@elgekko.net>
Fri, 23 Feb 2024 18:49:23 +0000 (19:49 +0100)
committerVásáry Dániel <vasary@elgekko.net>
Fri, 23 Feb 2024 18:49:23 +0000 (19:49 +0100)
zk-user-components/src/main/resources/web/js/dropupload/Dropupload.js

index e7e4bca6891d6582d175088ca59fce252d3342e0..4800b25a7604cdc867ef77709cfd78c2b4bdb6bb 100644 (file)
@@ -418,8 +418,10 @@ $jscomp.polyfill("Array.prototype.keys", function (c) {
             a.stop();
             if (a.originalEvent.dataTransfer.types.length) {
                 var b = a.originalEvent.dataTransfer.types[0];
-                if ("Files" != b && "public.file-url" !=
-                    b && "application/x-moz-file" != b) {
+                if ("Files" != b &&
+                    "public.file-url" != b &&
+                    "application/x-moz-file" != b &&
+                    "text/plain" != b) {
                     m();
                     return
                 }
@@ -493,8 +495,14 @@ $jscomp.polyfill("Array.prototype.keys", function (c) {
                     }
                 }
                 a = a.originalEvent.dataTransfer.items;
-                for (l = 0; l < g; l++)
-                    h = !1, a && (f = a[l], f.getAsEntry ? h = f.getAsEntry().isDirectory : f.webkitGetAsEntry && (h = f.webkitGetAsEntry().isDirectory)), h || (this._sid++, h = new dropupload.DropUploader(this, this._genKey(), b[l]), this._uploaders[h.id] = h);
+//                for (l = 0; l < g; l++)
+//                    h = !1, a && (f = a[l], f.getAsEntry ? h = f.getAsEntry().isDirectory : f.webkitGetAsEntry && (h = f.webkitGetAsEntry().isDirectory)), h || (this._sid++, h = new dropupload.DropUploader(this, this._genKey(), b[l]), this._uploaders[h.id] = h);
+
+                for (l = 0; l < g; l++) {
+                    this._sid++;
+                    var h = new dropupload.DropUploader(this, this._genKey(), b[l]);
+                    this._uploaders[h.id] = h;
+                }
                 this.checkFinish()
             }
         },