summaryrefslogtreecommitdiffstats
path: root/apps/files/js/mainfileinfodetailview.js
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-09-25 16:00:05 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-09-29 13:07:03 +0200
commitf41a38ba1510e65be675834aefe5b57368b119dd (patch)
tree3bcf1aa983af838a7a01c93a1b2efa7916543c0f /apps/files/js/mainfileinfodetailview.js
parentc269f658eb2ab8a69287a36b3bb923ae071a40d0 (diff)
downloadnextcloud-server-f41a38ba1510e65be675834aefe5b57368b119dd.tar.gz
nextcloud-server-f41a38ba1510e65be675834aefe5b57368b119dd.zip
Cover both width and height for the sidebar preview
Diffstat (limited to 'apps/files/js/mainfileinfodetailview.js')
-rw-r--r--apps/files/js/mainfileinfodetailview.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/files/js/mainfileinfodetailview.js b/apps/files/js/mainfileinfodetailview.js
index 82cca0d0fb3..c15b1fb2d63 100644
--- a/apps/files/js/mainfileinfodetailview.js
+++ b/apps/files/js/mainfileinfodetailview.js
@@ -140,7 +140,8 @@
},
loadPreview: function(path, mime, etag, $iconDiv, $container, isImage) {
- var maxImageHeight = ($container.parent().width() + 50) / (16/9); // 30px for negative margin
+ var maxImageWidth = $container.parent().width() + 50; // 50px for negative margins
+ var maxImageHeight = maxImageWidth / (16/9);
var smallPreviewSize = 75;
var isLandscape = function(img) {
@@ -164,8 +165,9 @@
mime: mime,
etag: etag,
y: isImage ? maxImageHeight : smallPreviewSize,
- x: isImage ? 99999 /* only limit on y */ : smallPreviewSize,
+ x: isImage ? maxImageWidth : smallPreviewSize,
a: isImage ? 1 : null,
+ mode: isImage ? 'cover' : null,
callback: function (previewUrl, img) {
$iconDiv.previewImg = previewUrl;