diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-09-23 14:56:13 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-09-23 14:56:13 +0200 |
commit | d0ea62a51cc689d19c3be8d2c1775f2c343b914e (patch) | |
tree | d7c459a2142f49e9fa416fd699f8b263099312e4 /apps | |
parent | ee649d58c5f82ee209ddc1812c1a896da53de707 (diff) | |
download | nextcloud-server-d0ea62a51cc689d19c3be8d2c1775f2c343b914e.tar.gz nextcloud-server-d0ea62a51cc689d19c3be8d2c1775f2c343b914e.zip |
adjust the height of the sidebar preview image when resizing the browser
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/css/detailsView.css | 8 | ||||
-rw-r--r-- | apps/files/js/mainfileinfodetailview.js | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/apps/files/css/detailsView.css b/apps/files/css/detailsView.css index 8acf884f219..faa26678562 100644 --- a/apps/files/css/detailsView.css +++ b/apps/files/css/detailsView.css @@ -32,12 +32,18 @@ #app-sidebar .image .thumbnail { width:100%; display:block; - height: 250px; background-repeat: no-repeat; background-position: center; background-size: 100%; float: none; margin: 0; + height: auto; +} + +#app-sidebar .image.landscape .thumbnail::before { + content: ''; + display: block; + padding-bottom: 56.25%; /* sets height of .thumbnail to 9/16 of the width */ } #app-sidebar .image.portrait .thumbnail { 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 () { |