mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-01 00:38:03 +02:00
adjusted cropbox max-height calculation to be dynamic
This commit is contained in:
@@ -145,8 +145,7 @@
|
||||
|
||||
#crop-picture-modal {
|
||||
#cropped-image {
|
||||
max-width: 50%;
|
||||
max-height: 350px;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.cropper-container.cropper-bg {
|
||||
|
||||
@@ -41,7 +41,11 @@ define('pictureCropper', ['translator', 'cropper'], function (translator, croppe
|
||||
backdrop: 'static',
|
||||
}).modal('show');
|
||||
|
||||
// Set cropper image max-height based on viewport
|
||||
var cropBoxHeight = parseInt($(window).height() / 2, 10);
|
||||
var img = document.getElementById('cropped-image');
|
||||
$(img).css('max-height', cropBoxHeight);
|
||||
|
||||
var cropperTool = new cropper.default(img, {
|
||||
aspectRatio: data.aspectRatio,
|
||||
autoCropArea: 1,
|
||||
|
||||
Reference in New Issue
Block a user