Skip to content
Snippets Groups Projects
Commit 01d93f81 authored by Robin Appelman's avatar Robin Appelman
Browse files

Show higher resolution previews for high dpi screens

parent 09ac61f5
No related branches found
No related tags found
No related merge requests found
......@@ -663,6 +663,8 @@ Files.generatePreviewUrl = function(urlSpec) {
if (!urlSpec.y) {
urlSpec.y = $('#filestable').data('preview-y');
}
urlSpec.y *= window.devicePixelRatio;
urlSpec.x *= window.devicePixelRatio;
urlSpec.forceIcon = 0;
return OC.generateUrl('/core/preview.png?') + $.param(urlSpec);
}
......@@ -670,7 +672,7 @@ Files.generatePreviewUrl = function(urlSpec) {
Files.lazyLoadPreview = function(path, mime, ready, width, height, etag) {
// get mime icon url
Files.getMimeIcon(mime, function(iconURL) {
var previewURL;
var previewURL,
urlSpec = {};
ready(iconURL); // set mimeicon URL
......@@ -696,7 +698,7 @@ Files.lazyLoadPreview = function(path, mime, ready, width, height, etag) {
if (img.width > 5) {
ready(previewURL);
}
}
};
img.src = previewURL;
});
};
......
......@@ -148,3 +148,7 @@ function outerHTML(node){
return h;
})(node);
}
// devicePixelRatio for IE10
window.devicePixelRatio = window.devicePixelRatio ||
window.screen.deviceXDPI / window.screen.logicalXDPI || 1;
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