summaryrefslogtreecommitdiffstats
path: root/apps/files/js/filelist.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/js/filelist.js')
-rw-r--r--apps/files/js/filelist.js54
1 files changed, 26 insertions, 28 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 417c4b9fe99..a3fd605ff7e 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -670,7 +670,7 @@
*/
_createRow: function(fileData, options) {
var td, simpleSize, basename, extension, sizeColor,
- icon = OC.Util.replaceSVGIcon(fileData.icon),
+ icon = OC.MimeType.getIconUrl(fileData.mimetype),
name = fileData.name,
type = fileData.type || 'file',
mtime = parseInt(fileData.mtime, 10),
@@ -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) {