Skip to content

Commit 69d524d

Browse files
committed
feat(tpl): remove form submit for dropped directory
Dropped directories can only be uploaded by uploadProgressively(). The fallback of form submit does not work.
1 parent 47d9375 commit 69d524d

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

src/tpl/asset/main.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,9 @@
723723
}
724724

725725
if (hasDir) {
726+
if (!uploadProgressively) {
727+
return;
728+
}
726729
if (!optDirFile && !optInnerDirFile) {
727730
return;
728731
}
@@ -735,14 +738,10 @@
735738
optInnerDirFile.click();
736739
}
737740
}
738-
if (uploadProgressively) {
739-
btnSubmit.disabled = true; // disable earlier
740-
getFilesFromItems(e.dataTransfer.items, function (files) {
741-
uploadProgressively(files);
742-
});
743-
} else {
744-
form.submit();
745-
}
741+
btnSubmit.disabled = true; // disable earlier
742+
getFilesFromItems(e.dataTransfer.items, function (files) {
743+
uploadProgressively(files);
744+
});
746745
} else {
747746
if (optFile && optActive !== optFile) {
748747
optFile.focus();

src/tpl/asset/main.js.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,9 @@ break;
636636
}
637637
}
638638
if (hasDir) {
639+
if (!uploadProgressively) {
640+
return;
641+
}
639642
if (!optDirFile && !optInnerDirFile) {
640643
return;
641644
}
@@ -648,15 +651,11 @@ optInnerDirFile.focus();
648651
optInnerDirFile.click();
649652
}
650653
}
651-
if (uploadProgressively) {
652654
btnSubmit.disabled = true; // disable earlier
653655
getFilesFromItems(e.dataTransfer.items, function (files) {
654656
uploadProgressively(files);
655657
});
656658
} else {
657-
form.submit();
658-
}
659-
} else {
660659
if (optFile && optActive !== optFile) {
661660
optFile.focus();
662661
optFile.click();

0 commit comments

Comments
 (0)