|
|
@@ -243,6 +243,7 @@ const Dialogs = { |
|
|
|
* @param {string} [type] Type of file picker : Choose, copy, move, copy and move |
|
|
|
* @param {string} [path] path to the folder that the the file can be picket from |
|
|
|
* @param {Object} [options] additonal options that need to be set |
|
|
|
* @param {Function} [options.filter] filter function for advanced filtering |
|
|
|
*/ |
|
|
|
filepicker: function(title, callback, multiselect, mimetypeFilter, modal, type, path, options) { |
|
|
|
var self = this |
|
|
@@ -296,6 +297,9 @@ const Dialogs = { |
|
|
|
sizeCol: t('core', 'Size'), |
|
|
|
modifiedCol: t('core', 'Modified') |
|
|
|
}).data('path', path).data('multiselect', multiselect).data('mimetype', mimetypeFilter).data('allowDirectoryChooser', options.allowDirectoryChooser) |
|
|
|
if (typeof(options.filter) === 'function') { |
|
|
|
self.$filePicker.data('filter', options.filter) |
|
|
|
} |
|
|
|
|
|
|
|
if (modal === undefined) { |
|
|
|
modal = false |
|
|
@@ -1124,6 +1128,7 @@ const Dialogs = { |
|
|
|
this.$filelistContainer.addClass('icon-loading') |
|
|
|
this.$filePicker.data('path', dir) |
|
|
|
var filter = this.$filePicker.data('mimetype') |
|
|
|
var advancedFilter = this.$filePicker.data('filter') |
|
|
|
if (typeof (filter) === 'string') { |
|
|
|
filter = [filter] |
|
|
|
} |
|
|
@@ -1142,6 +1147,10 @@ const Dialogs = { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
if (advancedFilter) { |
|
|
|
files = files.filter(advancedFilter) |
|
|
|
} |
|
|
|
|
|
|
|
// Check if the showHidden input field exist and if it exist follow it |
|
|
|
// Otherwise just show the hidden files |
|
|
|
const showHiddenInput = document.getElementById('showHiddenFiles') |