Do not activate cropper when the widget is set to readonly

This commit is contained in:
Hadi Nategh 2021-08-16 12:31:28 +02:00
parent 16f71b3a0b
commit 7122b6b2d0
2 changed files with 2 additions and 2 deletions

View File

@ -494,7 +494,7 @@ var et2_avatar = /** @class */ (function (_super) {
self._buildEditableLayer(noPhotoExists);
}).sendRequest(true);
}
if (this.options.crop) {
if (this.options.crop && !this.options.readonly) {
jQuery(this.image).cropper({
aspectRatio: 1 / 1,
crop: function (e) {

View File

@ -637,7 +637,7 @@ class et2_avatar extends et2_image
}
).sendRequest(true);
}
if (this.options.crop)
if (this.options.crop && !this.options.readonly)
{
jQuery(this.image).cropper({
aspectRatio: 1/1,