summaryrefslogtreecommitdiffstats
path: root/apps/files/js/mainfileinfodetailview.js
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-09-23 14:56:13 +0200
committerRobin Appelman <icewind@owncloud.com>2015-09-23 14:56:13 +0200
commitd0ea62a51cc689d19c3be8d2c1775f2c343b914e (patch)
treed7c459a2142f49e9fa416fd699f8b263099312e4 /apps/files/js/mainfileinfodetailview.js
parentee649d58c5f82ee209ddc1812c1a896da53de707 (diff)
downloadnextcloud-server-d0ea62a51cc689d19c3be8d2c1775f2c343b914e.tar.gz
nextcloud-server-d0ea62a51cc689d19c3be8d2c1775f2c343b914e.zip
adjust the height of the sidebar preview image when resizing the browser
Diffstat (limited to 'apps/files/js/mainfileinfodetailview.js')
-rw-r--r--apps/files/js/mainfileinfodetailview.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/apps/files/js/mainfileinfodetailview.js b/apps/files/js/mainfileinfodetailview.js
index 830f074f3f1..82cca0d0fb3 100644
--- a/apps/files/js/mainfileinfodetailview.js
+++ b/apps/files/js/mainfileinfodetailview.js
@@ -176,9 +176,7 @@
$iconDiv.removeClass('icon-loading icon-32');
var targetHeight = getTargetHeight(img);
if (this.model.isImage() && targetHeight > smallPreviewSize) {
- if (!isLandscape(img)) {
- $container.addClass('portrait');
- }
+ $container.addClass(isLandscape(img)? 'landscape': 'portrait');
$container.addClass('image');
}
@@ -186,7 +184,7 @@
// when we dont have a preview we show the mime icon in the error handler
$iconDiv.css({
'background-image': 'url("' + previewUrl + '")',
- 'height': targetHeight
+ height: (isLandscape(img) && targetHeight > smallPreviewSize)? 'auto': targetHeight
});
}.bind(this),
error: function () {