diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-04-04 18:45:49 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-04-04 18:45:49 +0200 |
commit | 710bbd34912b02d7b9a431bb9ff85f22a1475248 (patch) | |
tree | f4d8afe0e8816b4cf00dcb17d21a59fe420a886d | |
parent | 4028301dea2b7fc36b6a66ea05ae456246d7fb9f (diff) | |
parent | 01d93f81f67f71189dc5e484c29c1f4918078fd8 (diff) | |
download | nextcloud-server-710bbd34912b02d7b9a431bb9ff85f22a1475248.tar.gz nextcloud-server-710bbd34912b02d7b9a431bb9ff85f22a1475248.zip |
Merge pull request #8058 from owncloud/preview-highdpi
Show higher resolution previews for high dpi screens
-rw-r--r-- | apps/files/js/files.js | 6 | ||||
-rw-r--r-- | core/js/compatibility.js | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 4c2d87d808c..ceb096f0941 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -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; }); }; diff --git a/core/js/compatibility.js b/core/js/compatibility.js index 6548f95d42b..c07288857f2 100644 --- a/core/js/compatibility.js +++ b/core/js/compatibility.js @@ -148,3 +148,7 @@ function outerHTML(node){ return h; })(node); } + +// devicePixelRatio for IE10 +window.devicePixelRatio = window.devicePixelRatio || + window.screen.deviceXDPI / window.screen.logicalXDPI || 1; |