Bugfix: multiple uploads failed, found while investigating #322

This commit is contained in:
the-djmaze 2022-04-13 11:02:19 +02:00
parent c5cf9fc71d
commit 59857e66e7

10
vendors/jua/jua.js vendored
View file

@ -73,16 +73,10 @@
class Queue extends Array class Queue extends Array
{ {
constructor(limit) {
super();
this.limit = parseInt(limit || 0, 10);
}
push(fn, ...args) { push(fn, ...args) {
if (this.limit > this.length) {
super.push([fn, args]); super.push([fn, args]);
this.call(); this.call();
} }
}
call() { call() {
if (!this.running) { if (!this.running) {
this.running = true; this.running = true;
@ -134,7 +128,7 @@
hidden: {}, hidden: {},
limit: 0 limit: 0
}, options || {}); }, options || {});
self.oQueue = new Queue(1 == options.limit ? 1 : 2); self.oQueue = new Queue();
if (el) { if (el) {
el.style.position = 'relative'; el.style.position = 'relative';
@ -390,7 +384,7 @@
oInput.type = 'file'; oInput.type = 'file';
oInput.tabIndex = -1; oInput.tabIndex = -1;
oInput.style.display = 'none'; oInput.style.display = 'none';
oInput.multiple = 1 < limit; oInput.multiple = 1 != limit;
oClickElement.addEventListener('click', onClick); oClickElement.addEventListener('click', onClick);