summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-06-15 13:30:44 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-06-15 13:30:44 +0200
commit433db4802780f358ebf31c11e8ae898ffdb78fed (patch)
treee73ffff34e5aca858b51c283fc1b96136091dffe /apps
parentb8ab6fb68dd75b67d62d498ceee006f8ef16012f (diff)
parent7b84343cfc998e1e110965079fbe9581423125dd (diff)
downloadnextcloud-server-433db4802780f358ebf31c11e8ae898ffdb78fed.tar.gz
nextcloud-server-433db4802780f358ebf31c11e8ae898ffdb78fed.zip
Merge pull request #16911 from oparoz/prettier-public-thumbnails
Determine the size we need before asking for a thumbnail
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/js/public.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 6261c70626d..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,6 +159,8 @@ OCA.Sharing.PublicApp = {
this.fileList.generatePreviewUrl = function (urlSpec) {
urlSpec.t = $('#dirToken').val();
+ 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);
};