Fix avatar cropper gets closed right after uploading an image

This commit is contained in:
Hadi Nategh 2022-09-13 12:09:55 +02:00
parent 98584884b0
commit 44e2938d05

View File

@ -299,6 +299,8 @@ export class Et2Avatar extends Et2Widget(SlotMixin(SlAvatar)) implements et2_IDe
let widget = document.getElementById('_cropper_image');
switch(_buttons)
{
case 0:
return true;
case 1:
let canvas = jQuery(widget._imageNode).cropper('getCroppedCanvas');
this.image = canvas.toDataURL("image/jpeg", 1.0)
@ -315,6 +317,8 @@ export class Et2Avatar extends Et2Widget(SlotMixin(SlAvatar)) implements et2_IDe
case '_rotate_r':
jQuery(widget._imageNode).cropper('rotate', 90);
return false;
default:
return false;
}
}