Skip to content

Commit eb78fa7

Browse files
committed
refactor(tpl): extract enableFormUploadProgress()
1 parent 89266b0 commit eb78fa7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/tpl/frontend/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,10 @@
810810
btnSubmit.disabled = true;
811811
}
812812

813+
return uploadProgressively;
814+
}
815+
816+
function enableFormUploadProgress(uploadProgressively) {
813817
form.addEventListener('submit', function (e) {
814818
e.stopPropagation();
815819
e.preventDefault();
@@ -822,7 +826,6 @@
822826
var files = Array.prototype.slice.call(fileInput.files);
823827
uploadProgressively(files);
824828
});
825-
return uploadProgressively;
826829
}
827830

828831
function enableAddDragDrop(uploadProgressively) {
@@ -1024,6 +1027,7 @@
10241027

10251028
enableAddDirFile();
10261029
var uploadProgressively = enableUploadProgress();
1030+
enableFormUploadProgress(uploadProgressively);
10271031
enableAddDragDrop(uploadProgressively);
10281032
enableAddPaste(uploadProgressively);
10291033
}

0 commit comments

Comments
 (0)