From f84fe479a5af35cc51b4bee39492093c75ddc64e Mon Sep 17 00:00:00 2001 From: kondou Date: Thu, 5 Sep 2013 18:40:55 +0200 Subject: Only use mimetype_list and clean up a bit --- core/js/oc-dialogs.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'core/js/oc-dialogs.js') diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index f4c339702e1..ed4d7c678e1 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -244,17 +244,19 @@ var OCdialogs = { return defer.promise(); }, _getFileList: function(dir, mimeType) { - if (typeof(mimeType) === "object") { - return $.getJSON( - OC.filePath('files', 'ajax', 'rawlist.php'), - {dir: dir, "mimetype_list": JSON.stringify(mimeType)} - ); - } else { - return $.getJSON( - OC.filePath('files', 'ajax', 'rawlist.php'), - {dir: dir, mimetype: mimeType} - ); + if (typeof(mimeType) === "string") { + var tmp = mimeType; + mimeType = new Array(); + mimeType[0] = tmp; } + + return $.getJSON( + OC.filePath('files', 'ajax', 'rawlist.php'), + { + dir: dir, + mimetypes: JSON.stringify(mimeType) + } + ); }, _determineValue: function(element) { if ( $(element).attr('type') === 'checkbox' ) { -- cgit v1.2.3