Skip to content

Commit cb4b2b6

Browse files
committed
fix(tpl): disable file input when uploading
1 parent afc5dbb commit cb4b2b6

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/tpl/asset/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@
547547
if (elProgress) {
548548
elProgress.style.width = '';
549549
}
550+
fileInput.disabled = false;
550551
btnSubmit.disabled = false;
551552
}
552553

@@ -588,6 +589,7 @@
588589

589590
xhr.open(form.method, form.action);
590591
xhr.send(parts);
592+
fileInput.disabled = true;
591593
btnSubmit.disabled = true;
592594
}
593595

src/tpl/asset/main.js.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@ function onComplete() {
486486
if (elProgress) {
487487
elProgress.style.width = '';
488488
}
489+
fileInput.disabled = false;
489490
btnSubmit.disabled = false;
490491
}
491492
function onLoad() {
@@ -521,6 +522,7 @@ xhr.upload.addEventListener('progress', onProgress);
521522
}
522523
xhr.open(form.method, form.action);
523524
xhr.send(parts);
525+
fileInput.disabled = true;
524526
btnSubmit.disabled = true;
525527
}
526528
form.addEventListener('submit', function (e) {

0 commit comments

Comments
 (0)