diff options
author | Robin Appelman <robin@icewind.nl> | 2016-10-19 14:22:33 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2016-10-19 14:22:33 +0200 |
commit | 31745d69f724a89e17632c82e7d76e104cc2764f (patch) | |
tree | f815ce2ee9c2e0b4daa6a36b8a329617e98ee69d /core/js | |
parent | 67050fd463181f96a6a351e4fab19dbad65d2dd9 (diff) | |
download | nextcloud-server-31745d69f724a89e17632c82e7d76e104cc2764f.tar.gz nextcloud-server-31745d69f724a89e17632c82e7d76e104cc2764f.zip |
fix filepicker with no mimetype filter
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/oc-dialogs.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index 8df62a1842e..7a7876bf30f 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -754,9 +754,12 @@ var OCdialogs = { filter = [filter]; } self.filepicker.filesClient.getFolderContents(dir).then(function(status, files) { - files = files.filter(function(file) { - return file.type === 'dir' || filter.indexOf(file.mimetype) !== -1; - }).sort(function(a, b) { + if (filter) { + files = files.filter(function (file) { + return filter == [] || file.type === 'dir' || filter.indexOf(file.mimetype) !== -1; + }); + } + files = files.sort(function(a, b) { if (a.type === 'dir' && b.type !== 'dir') { return -1; } else if(a.type !== 'dir' && b.type === 'dir') { |