diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-07 10:23:58 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-07 10:23:58 +0100 |
commit | 00b592f2a648006265477389db96b157b2f8db37 (patch) | |
tree | 1638dd35e79f0d4c79efb3880eb51fac50588b71 /apps | |
parent | cd6bc79c400e2822830a52822ab5e86a2d7634fb (diff) | |
parent | ee87f12c092776b3dfc33e5af6cd1e4697406866 (diff) | |
download | nextcloud-server-00b592f2a648006265477389db96b157b2f8db37.tar.gz nextcloud-server-00b592f2a648006265477389db96b157b2f8db37.zip |
Merge pull request #20581 from owncloud/public-page-preview-hidpi-scale
Fix hidpi previews on public page
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/js/public.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 0b78d200b94..70c1ba5c0c2 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -102,12 +102,12 @@ OCA.Sharing.PublicApp = { // dynamically load image previews var bottomMargin = 350; - var previewWidth = Math.ceil($(window).width() * window.devicePixelRatio); - var previewHeight = Math.ceil(($(window).height() - bottomMargin) * window.devicePixelRatio); + var previewWidth = $(window).width(); + var previewHeight = $(window).height() - bottomMargin; previewHeight = Math.max(200, previewHeight); var params = { - x: previewWidth, - y: previewHeight, + x: Math.ceil(previewWidth * window.devicePixelRatio), + y: Math.ceil(previewHeight * window.devicePixelRatio), a: 'true', file: encodeURIComponent(this.initialDir + $('#filename').val()), t: token, @@ -115,6 +115,10 @@ OCA.Sharing.PublicApp = { }; var img = $('<img class="publicpreview" alt="">'); + img.css({ + 'max-width': previewWidth, + 'max-height': previewHeight + }); var fileSize = parseInt($('#filesize').val(), 10); var maxGifSize = parseInt($('#maxSizeAnimateGif').val(), 10); |