aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-11-18 16:45:19 +0100
committerRobin Appelman <icewind@owncloud.com>2015-11-18 16:45:19 +0100
commitee87f12c092776b3dfc33e5af6cd1e4697406866 (patch)
treefaa97410d8125a95391a88b74531a60cab024d61 /apps/files_sharing/js
parent90bd53c94e6d52e2e79869f105651a5dcee8a3e6 (diff)
downloadnextcloud-server-ee87f12c092776b3dfc33e5af6cd1e4697406866.tar.gz
nextcloud-server-ee87f12c092776b3dfc33e5af6cd1e4697406866.zip
Fix hidpi previews on public page
Diffstat (limited to 'apps/files_sharing/js')
-rw-r--r--apps/files_sharing/js/public.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 246b639f652..9ba456e867f 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -90,12 +90,12 @@ OCA.Sharing.PublicApp = {
// dynamically load image previews
var token = $('#sharingToken').val();
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,
@@ -103,6 +103,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);