Merge pull request #19307 from owncloud/large-sidebar-preview-resize
adjust the height of the sidebar preview image when resizing the browser
This commit is contained in:
commit
158c962fcc
2 changed files with 9 additions and 5 deletions
|
@ -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 {
|
||||
|
|
|
@ -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 () {
|
||||
|
|
Loading…
Reference in a new issue