summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js
diff options
context:
space:
mode:
authorOlivier Paroz <github@oparoz.com>2015-06-12 18:56:18 +0200
committerOlivier Paroz <github@oparoz.com>2015-06-12 18:56:18 +0200
commit7b84343cfc998e1e110965079fbe9581423125dd (patch)
treeffca186e1e1d5a1e1cdd68d78f240d5eaaa9bd9d /apps/files_sharing/js
parent8ff4a66f0150624b8b08c4c47765016bd2e3a2ab (diff)
downloadnextcloud-server-7b84343cfc998e1e110965079fbe9581423125dd.tar.gz
nextcloud-server-7b84343cfc998e1e110965079fbe9581423125dd.zip
floats are not welcome when setting the size of a preview
Diffstat (limited to 'apps/files_sharing/js')
-rw-r--r--apps/files_sharing/js/public.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 32a469414d6..5923e426f05 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -89,8 +89,8 @@ OCA.Sharing.PublicApp = {
// dynamically load image previews
var token = $('#sharingToken').val();
var bottomMargin = 350;
- var previewWidth = $(window).width() * window.devicePixelRatio;
- var previewHeight = ($(window).height() - bottomMargin) * window.devicePixelRatio;
+ var previewWidth = Math.floor($(window).width() * window.devicePixelRatio);
+ var previewHeight = Math.floor(($(window).height() - bottomMargin) * window.devicePixelRatio);
previewHeight = Math.max(200, previewHeight);
var params = {
x: previewWidth,
@@ -159,8 +159,8 @@ OCA.Sharing.PublicApp = {
this.fileList.generatePreviewUrl = function (urlSpec) {
urlSpec.t = $('#dirToken').val();
- urlSpec.y = 36 * window.devicePixelRatio;
- urlSpec.x = 36 * window.devicePixelRatio;
+ urlSpec.y = Math.floor(36 * window.devicePixelRatio);
+ urlSpec.x = Math.floor(36 * window.devicePixelRatio);
return OC.generateUrl('/apps/files_sharing/ajax/publicpreview.php?') + $.param(urlSpec);
};