diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2015-07-08 14:55:11 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2015-07-09 13:40:13 +0200 |
commit | 5c381ea5326501e316704b642aa5b82acd45b20b (patch) | |
tree | 51217c9c3a7cfc194abbd7135d896fa6e11200c3 | |
parent | 1aa2f6638ff1031d30dcb2e28d5f86d0978abdae (diff) | |
download | nextcloud-server-5c381ea5326501e316704b642aa5b82acd45b20b.tar.gz nextcloud-server-5c381ea5326501e316704b642aa5b82acd45b20b.zip |
Move calls to Files.getMimeIcon to OC.MimeType.getIconUrl
-rw-r--r-- | apps/files/js/filelist.js | 52 | ||||
-rw-r--r-- | core/js/oc-dialogs.js | 5 |
2 files changed, 27 insertions, 30 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 417c4b9fe99..a08c23d4fa0 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1213,36 +1213,34 @@ var etag = options.etag; // get mime icon url - OCA.Files.Files.getMimeIcon(mime, function(iconURL) { - var previewURL, - urlSpec = {}; - ready(iconURL); // set mimeicon URL + var iconURL = OC.MimeType.getIconUrl(mime); + var previewURL, + urlSpec = {}; + ready(iconURL); // set mimeicon URL - urlSpec.file = OCA.Files.Files.fixPath(path); + urlSpec.file = OCA.Files.Files.fixPath(path); - if (etag){ - // use etag as cache buster - urlSpec.c = etag; - } - else { - console.warn('OCA.Files.FileList.lazyLoadPreview(): missing etag argument'); - } + if (etag){ + // use etag as cache buster + urlSpec.c = etag; + } else { + console.warn('OCA.Files.FileList.lazyLoadPreview(): missing etag argument'); + } - previewURL = self.generatePreviewUrl(urlSpec); - previewURL = previewURL.replace('(', '%28'); - previewURL = previewURL.replace(')', '%29'); - - // preload image to prevent delay - // this will make the browser cache the image - var img = new Image(); - img.onload = function(){ - // if loading the preview image failed (no preview for the mimetype) then img.width will < 5 - if (img.width > 5) { - ready(previewURL); - } - }; - img.src = previewURL; - }); + previewURL = self.generatePreviewUrl(urlSpec); + previewURL = previewURL.replace('(', '%28'); + previewURL = previewURL.replace(')', '%29'); + + // preload image to prevent delay + // this will make the browser cache the image + var img = new Image(); + img.onload = function(){ + // if loading the preview image failed (no preview for the mimetype) then img.width will < 5 + if (img.width > 5) { + ready(previewURL); + } + }; + img.src = previewURL; }, setDirectoryPermissions: function(permissions) { diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index 9f88c268369..52ed34f61ec 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -396,9 +396,8 @@ var OCdialogs = { function(path){ $replacementDiv.find('.icon').css('background-image','url(' + path + ')'); }, function(){ - Files.getMimeIcon(replacement.type,function(path){ - $replacementDiv.find('.icon').css('background-image','url(' + path + ')'); - }); + path = OC.MimeType.getIconUrl(replacement.type); + $replacementDiv.find('.icon').css('background-image','url(' + path + ')'); } ); $conflicts.append($conflict); |