From 74965654decf2b814e864be79a80b132258dd2e1 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 24 May 2017 14:50:22 -0400 Subject: [PATCH] adjusted cropbox max-height calculation to be dynamic --- public/less/generics.less | 3 +-- public/src/modules/pictureCropper.js | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/public/less/generics.less b/public/less/generics.less index d0980f9f48..bab162e81f 100644 --- a/public/less/generics.less +++ b/public/less/generics.less @@ -145,8 +145,7 @@ #crop-picture-modal { #cropped-image { - max-width: 50%; - max-height: 350px; + max-width: 100%; } .cropper-container.cropper-bg { diff --git a/public/src/modules/pictureCropper.js b/public/src/modules/pictureCropper.js index 075a43e709..d413c3d156 100644 --- a/public/src/modules/pictureCropper.js +++ b/public/src/modules/pictureCropper.js @@ -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,