Skip to content
Snippets Groups Projects
Unverified Commit 8d093e97 authored by Robin Appelman's avatar Robin Appelman
Browse files

use mimetype icons in filepicker if there is no preview


Signed-off-by: default avatarRobin Appelman <robin@icewind.nl>
parent 53eb0f7f
No related branches found
No related tags found
No related merge requests found
......@@ -769,10 +769,17 @@ var OCdialogs = {
});
if (entry.type === 'file') {
var urlSpec = {
file: dir + '/' + entry.name
file: dir + '/' + entry.name,
};
$li.find('img').attr('src', OC.MimeType.getIconUrl(entry.mimetype));
var img = new Image();
var previewUrl = OC.generateUrl('/core/preview.png?') + $.param(urlSpec);
$li.find('img').attr('src', previewUrl);
img.onload = function() {
if (img.width > 5) {
$li.find('img').attr('src', previewUrl);
}
};
img.src = previewUrl;
}
else {
$li.find('img').attr('src', OC.Util.replaceSVGIcon(entry.icon));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment