mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 04:25:55 +01:00
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:
@@ -145,7 +145,8 @@
|
|||||||
|
|
||||||
#crop-picture-modal {
|
#crop-picture-modal {
|
||||||
#cropped-image {
|
#cropped-image {
|
||||||
max-width: 100%;
|
max-width: 50%;
|
||||||
|
max-height: 350px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cropper-container.cropper-bg {
|
.cropper-container.cropper-bg {
|
||||||
|
|||||||
@@ -219,8 +219,6 @@ define('forum/account/edit', ['forum/account/header', 'translator', 'components'
|
|||||||
paramValue: ajaxify.data.theirid,
|
paramValue: ajaxify.data.theirid,
|
||||||
fileSize: ajaxify.data.maximumProfileImageSize,
|
fileSize: ajaxify.data.maximumProfileImageSize,
|
||||||
allowSkippingCrop: false,
|
allowSkippingCrop: false,
|
||||||
restrictImageDimension: true,
|
|
||||||
imageDimension: ajaxify.data.profileImageDimension,
|
|
||||||
title: '[[user:upload_picture]]',
|
title: '[[user:upload_picture]]',
|
||||||
description: '[[user:upload_a_picture]]',
|
description: '[[user:upload_a_picture]]',
|
||||||
accept: '.png,.jpg,.bmp',
|
accept: '.png,.jpg,.bmp',
|
||||||
@@ -258,8 +256,6 @@ define('forum/account/edit', ['forum/account/header', 'translator', 'components'
|
|||||||
socketMethod: 'user.uploadCroppedPicture',
|
socketMethod: 'user.uploadCroppedPicture',
|
||||||
aspectRatio: '1 / 1',
|
aspectRatio: '1 / 1',
|
||||||
allowSkippingCrop: false,
|
allowSkippingCrop: false,
|
||||||
restrictImageDimension: true,
|
|
||||||
imageDimension: ajaxify.data.profileImageDimension,
|
|
||||||
paramName: 'uid',
|
paramName: 'uid',
|
||||||
paramValue: ajaxify.data.theirid,
|
paramValue: ajaxify.data.theirid,
|
||||||
}, onUploadComplete);
|
}, onUploadComplete);
|
||||||
|
|||||||
@@ -37,13 +37,16 @@ define('pictureCropper', ['translator', 'cropper'], function (translator, croppe
|
|||||||
}, function (cropperHtml) {
|
}, function (cropperHtml) {
|
||||||
translator.translate(cropperHtml, function (translated) {
|
translator.translate(cropperHtml, function (translated) {
|
||||||
var cropperModal = $(translated);
|
var cropperModal = $(translated);
|
||||||
cropperModal.modal('show');
|
cropperModal.modal({
|
||||||
|
backdrop: 'static',
|
||||||
|
}).modal('show');
|
||||||
|
|
||||||
var img = document.getElementById('cropped-image');
|
var img = document.getElementById('cropped-image');
|
||||||
var cropperTool = new cropper.default(img, {
|
var cropperTool = new cropper.default(img, {
|
||||||
aspectRatio: data.aspectRatio,
|
aspectRatio: data.aspectRatio,
|
||||||
autoCropArea: 1,
|
autoCropArea: 1,
|
||||||
viewMode: 1,
|
viewMode: 1,
|
||||||
|
zoomable: 0,
|
||||||
cropmove: function () {
|
cropmove: function () {
|
||||||
if (data.restrictImageDimension) {
|
if (data.restrictImageDimension) {
|
||||||
if (cropperTool.cropBoxData.width > data.imageDimension) {
|
if (cropperTool.cropBoxData.width > data.imageDimension) {
|
||||||
|
|||||||
Reference in New Issue
Block a user