Skip to content

Commit 1aa3305

Browse files
committedMay 5, 2024
add filemanager.disableMultiUpload config
1 parent 298757c commit 1aa3305

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎index.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ import {
5252
/**
5353
* flag indicating whether uploading folders is supported
5454
*/
55-
const supportsUploadingFolders = !!(window.DataTransferItem && DataTransferItem.prototype.webkitGetAsEntry);
55+
const supportsUploadingFolders = core =>
56+
core.config('filemanager.disableMultiUpload', false) !== true
57+
&& !!(window.DataTransferItem && DataTransferItem.prototype.webkitGetAsEntry);
5658

5759
/**
5860
* Creates default settings
@@ -73,7 +75,7 @@ const createWindowOptions = (core, proc, title) => ({
7375
mediaQueries: {
7476
small: 'screen and (max-width: 400px)'
7577
},
76-
droppable: {dataTransferProperty: supportsUploadingFolders ? 'items' : 'files'},
78+
droppable: {dataTransferProperty: supportsUploadingFolders(core) ? 'items' : 'files'},
7779
},
7880
dimension: Object.assign({
7981
width: 400,
@@ -414,7 +416,7 @@ const vfsActionFactory = (core, proc, win, dialog, state) => {
414416
};
415417

416418
const uploadBrowserFiles = async (items) => {
417-
if (!supportsUploadingFolders) {
419+
if (!supportsUploadingFolders(core)) {
418420
return legacyUploadBrowserFiles(items);
419421
}
420422

0 commit comments

Comments
 (0)