From: Vásáry Dániel Date: Fri, 23 Feb 2024 18:49:23 +0000 (+0100) Subject: Drop upload from browser downloads fixed X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=aceca4f358ec8dd6a11f42e5fc0732484e3fc647;p=sly-crm.git Drop upload from browser downloads fixed --- 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() } },