aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js/files.js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-02-28 14:54:10 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2014-02-28 14:54:10 +0100
commit15d1df055b093ecce0c5ae52561dd73584145c7c (patch)
tree4f2b10bacfa5371e3f2a53122a3165bf94114d01 /apps/files/js/files.js
parent65843e245996c9ecfd167be2b520bb917b32aa7e (diff)
parentdd32091016481b0b6845e03ea87ce419b3cda19e (diff)
downloadnextcloud-server-15d1df055b093ecce0c5ae52561dd73584145c7c.tar.gz
nextcloud-server-15d1df055b093ecce0c5ae52561dd73584145c7c.zip
Merge branch 'master' into display-share-owner-master
Conflicts: apps/files_sharing/lib/cache.php
Diffstat (limited to 'apps/files/js/files.js')
-rw-r--r--apps/files/js/files.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index fbac601f67a..f4546120702 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -734,6 +734,9 @@ Files.getMimeIcon = function(mime, ready) {
ready(Files.getMimeIcon.cache[mime]);
} else {
$.get( OC.filePath('files','ajax','mimeicon.php'), {mime: mime}, function(path) {
+ if(SVGSupport()){
+ path = path.substr(0, path.length-4) + '.svg';
+ }
Files.getMimeIcon.cache[mime]=path;
ready(Files.getMimeIcon.cache[mime]);
});
@@ -783,13 +786,16 @@ Files.lazyLoadPreview = function(path, mime, ready, width, height, etag) {
}
previewURL = previewURL.replace('(', '%28');
previewURL = previewURL.replace(')', '%29');
+ previewURL += '&forceIcon=0';
// preload image to prevent delay
// this will make the browser cache the image
var img = new Image();
img.onload = function(){
- //set preview thumbnail URL
- ready(previewURL);
+ // 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;
});