removed cropper zoom and using image scaling to show entire image. Click on modal backdrop during crop will no longer close modal

This commit is contained in:
Julian Lam
2017-05-24 12:36:53 -04:00
parent 5cb53406fe
commit 30bec51a21
3 changed files with 6 additions and 6 deletions

View File

@@ -145,7 +145,8 @@
#crop-picture-modal {
#cropped-image {
max-width: 100%;
max-width: 50%;
max-height: 350px;
}
.cropper-container.cropper-bg {

View File

@@ -219,8 +219,6 @@ define('forum/account/edit', ['forum/account/header', 'translator', 'components'
paramValue: ajaxify.data.theirid,
fileSize: ajaxify.data.maximumProfileImageSize,
allowSkippingCrop: false,
restrictImageDimension: true,
imageDimension: ajaxify.data.profileImageDimension,
title: '[[user:upload_picture]]',
description: '[[user:upload_a_picture]]',
accept: '.png,.jpg,.bmp',
@@ -258,8 +256,6 @@ define('forum/account/edit', ['forum/account/header', 'translator', 'components'
socketMethod: 'user.uploadCroppedPicture',
aspectRatio: '1 / 1',
allowSkippingCrop: false,
restrictImageDimension: true,
imageDimension: ajaxify.data.profileImageDimension,
paramName: 'uid',
paramValue: ajaxify.data.theirid,
}, onUploadComplete);

View File

@@ -37,13 +37,16 @@ define('pictureCropper', ['translator', 'cropper'], function (translator, croppe
}, function (cropperHtml) {
translator.translate(cropperHtml, function (translated) {
var cropperModal = $(translated);
cropperModal.modal('show');
cropperModal.modal({
backdrop: 'static',
}).modal('show');
var img = document.getElementById('cropped-image');
var cropperTool = new cropper.default(img, {
aspectRatio: data.aspectRatio,
autoCropArea: 1,
viewMode: 1,
zoomable: 0,
cropmove: function () {
if (data.restrictImageDimension) {
if (cropperTool.cropBoxData.width > data.imageDimension) {