diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2015-07-08 13:56:39 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2015-07-09 13:40:12 +0200 |
commit | 1aa2f6638ff1031d30dcb2e28d5f86d0978abdae (patch) | |
tree | a89bd610a846d5b3ff9c61896f73764e5558ed73 /apps/files/js/files.js | |
parent | 2b86ba43e33b2cd4339722548d22800ea4218a57 (diff) | |
download | nextcloud-server-1aa2f6638ff1031d30dcb2e28d5f86d0978abdae.tar.gz nextcloud-server-1aa2f6638ff1031d30dcb2e28d5f86d0978abdae.zip |
Make getMimeIcon use OC.MimeType.getIconUrl
Diffstat (limited to 'apps/files/js/files.js')
-rw-r--r-- | apps/files/js/files.js | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 44868e78bd0..1b498769dd6 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -163,18 +163,14 @@ return OC.filePath('files', 'ajax', action + '.php') + q; }, + /** + * Fetch the icon url for the mimetype + * @param {string} mime The mimetype + * @param {Files~mimeicon} ready Function to call when mimetype is retrieved + * @deprecated use OC.MimeType.getIconUrl(mime) + */ getMimeIcon: function(mime, ready) { - if (Files.getMimeIcon.cache[mime]) { - ready(Files.getMimeIcon.cache[mime]); - } else { - $.get( OC.filePath('files','ajax','mimeicon.php'), {mime: mime}, function(path) { - if(OC.Util.hasSVGSupport()){ - path = path.substr(0, path.length-4) + '.svg'; - } - Files.getMimeIcon.cache[mime]=path; - ready(Files.getMimeIcon.cache[mime]); - }); - } + ready(OC.MimeType.getIconUrl(mime)); }, /** @@ -211,7 +207,6 @@ * Initialize the files view */ initialize: function() { - Files.getMimeIcon.cache = {}; Files.bindKeyboardShortcuts(document, $); // TODO: move file list related code (upload) to OCA.Files.FileList |