Skip to content

Commit 47d9375

Browse files
committed
feat(tpl/upload): skip clear file input when switching between "dir" tabs
When switching between "Dir" and "Dir contents" tab, It is unnecessary to clear the file input. As file input change triggers auto upload action, there is no way to switch to other tabs. This change is just a backup solution.
1 parent fdf3002 commit 47d9375

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/tpl/asset/main.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,15 +460,15 @@
460460
}
461461
}
462462

463-
function onClickOptDirFile(e) {
464-
if (onClickOpt(optDirFile, Boolean(e))) {
463+
function onClickOptDirFile() {
464+
if (onClickOpt(optDirFile, optActive === optFile)) {
465465
fileInput.name = dirFile;
466466
fileInput.webkitdirectory = true;
467467
}
468468
}
469469

470-
function onClickOptInnerDirFile(e) {
471-
if (onClickOpt(optInnerDirFile, Boolean(e))) {
470+
function onClickOptInnerDirFile() {
471+
if (onClickOpt(optInnerDirFile, optActive === optFile)) {
472472
fileInput.name = innerDirFile;
473473
fileInput.webkitdirectory = true;
474474
}

src/tpl/asset/main.js.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -407,14 +407,14 @@ fileInput.name = file;
407407
fileInput.webkitdirectory = false;
408408
}
409409
}
410-
function onClickOptDirFile(e) {
411-
if (onClickOpt(optDirFile, Boolean(e))) {
410+
function onClickOptDirFile() {
411+
if (onClickOpt(optDirFile, optActive === optFile)) {
412412
fileInput.name = dirFile;
413413
fileInput.webkitdirectory = true;
414414
}
415415
}
416-
function onClickOptInnerDirFile(e) {
417-
if (onClickOpt(optInnerDirFile, Boolean(e))) {
416+
function onClickOptInnerDirFile() {
417+
if (onClickOpt(optInnerDirFile, optActive === optFile)) {
418418
fileInput.name = innerDirFile;
419419
fileInput.webkitdirectory = true;
420420
}

0 commit comments

Comments
 (0)