From aceca4f358ec8dd6a11f42e5fc0732484e3fc647 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1s=C3=A1ry=20D=C3=A1niel?= Date: Fri, 23 Feb 2024 19:49:23 +0100 Subject: [PATCH] Drop upload from browser downloads fixed --- .../resources/web/js/dropupload/Dropupload.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/zk-user-components/src/main/resources/web/js/dropupload/Dropupload.js b/zk-user-components/src/main/resources/web/js/dropupload/Dropupload.js index e7e4bca..4800b25 100644 --- a/zk-user-components/src/main/resources/web/js/dropupload/Dropupload.js +++ b/zk-user-components/src/main/resources/web/js/dropupload/Dropupload.js @@ -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() } }, -- 2.54.0