Show higher resolution previews for high dpi screens

This commit is contained in:
Robin Appelman 2014-04-04 17:10:46 +02:00
parent 09ac61f53b
commit 01d93f81f6
2 changed files with 8 additions and 2 deletions

View File

@ -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;
});
};

View File

@ -148,3 +148,7 @@ function outerHTML(node){
return h;
})(node);
}
// devicePixelRatio for IE10
window.devicePixelRatio = window.devicePixelRatio ||
window.screen.deviceXDPI / window.screen.logicalXDPI || 1;