mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-19 14:43:49 +09:00
Merge pull request #1335 from ultimatemember/fix/cropper_js
New cropper.js
This commit is contained in:
+3273
-1571
File diff suppressed because it is too large
Load Diff
@@ -539,9 +539,6 @@ function initCrop_UM() {
|
||||
zoomable: false,
|
||||
rotatable: false,
|
||||
dashed: false,
|
||||
done: function(data) {
|
||||
target_img.parent().attr('data-coord', Math.round(data.x) + ',' + Math.round(data.y) + ',' + Math.round(data.width) + ',' + Math.round(data.height) );
|
||||
}
|
||||
};
|
||||
|
||||
} else if ( crop_data == 'cover' ) {
|
||||
@@ -556,9 +553,6 @@ function initCrop_UM() {
|
||||
zoomable: false,
|
||||
rotatable: false,
|
||||
dashed: false,
|
||||
done: function(data) {
|
||||
target_img.parent().attr('data-coord', Math.round(data.x) + ',' + Math.round(data.y) + ',' + Math.round(data.width) + ',' + Math.round(data.height) );
|
||||
}
|
||||
};
|
||||
|
||||
} else if ( crop_data == 'user' ) {
|
||||
@@ -571,16 +565,13 @@ function initCrop_UM() {
|
||||
zoomable: false,
|
||||
rotatable: false,
|
||||
dashed: false,
|
||||
done: function(data) {
|
||||
target_img.parent().attr('data-coord', Math.round(data.x) + ',' + Math.round(data.y) + ',' + Math.round(data.width) + ',' + Math.round(data.height) );
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
if ( crop_data != 0 ) {
|
||||
target_img.cropper( opts );
|
||||
jQuery('.um-single-image-preview img.cropper-hidden').cropper('destroy');
|
||||
cropper = new Cropper(target_img[0], opts);
|
||||
|
||||
jQuery('.um-single-image-preview img.lazyloaded').addClass('cropper-hidden');
|
||||
jQuery('.um-single-image-preview img.lazyloaded').removeClass('lazyloaded');
|
||||
jQuery('.um-single-image-preview .cropper-container').append('<div class="um-clear"></div>');
|
||||
@@ -727,7 +718,9 @@ function um_modal_responsive() {
|
||||
}
|
||||
|
||||
function um_remove_modal() {
|
||||
jQuery('img.cropper-hidden').cropper('destroy');
|
||||
if ( jQuery('.cropper-hidden').length > 0 ) {
|
||||
cropper.destroy();
|
||||
}
|
||||
|
||||
jQuery('body,html,textarea').css("overflow", "auto");
|
||||
|
||||
@@ -837,4 +830,4 @@ function um_selected( selected, current ){
|
||||
if( selected == current ){
|
||||
return "selected='selected'";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ jQuery(document).ready(function() {
|
||||
var key = jQuery(this).attr('data-key');
|
||||
var img_c = jQuery(this).parents('.um-modal-body').find('.um-single-image-preview');
|
||||
var src = img_c.find('img').attr('src');
|
||||
var coord = img_c.attr('data-coord');
|
||||
|
||||
var file = img_c.find('img').data('file');
|
||||
var user_id = 0;
|
||||
if ( jQuery(this).parents('#um_upload_single').data('user_id') ) {
|
||||
@@ -111,6 +111,10 @@ jQuery(document).ready(function() {
|
||||
mode = $formWrapper.attr('data-mode');
|
||||
}
|
||||
|
||||
if ( jQuery('.cropper-hidden').length > 0 ) {
|
||||
var data = cropper.getData();
|
||||
var coord = Math.round(data.x) + ',' + Math.round(data.y) + ',' + Math.round(data.width) + ',' + Math.round(data.height);
|
||||
}
|
||||
if ( coord ) {
|
||||
|
||||
jQuery(this).html( jQuery(this).attr('data-processing') ).addClass('disabled');
|
||||
|
||||
Reference in New Issue
Block a user