diff --git a/src/plugins/imageProperties.ts b/src/plugins/imageProperties.ts index 3ee436b49..e967a0a36 100644 --- a/src/plugins/imageProperties.ts +++ b/src/plugins/imageProperties.ts @@ -476,9 +476,9 @@ export default function (editor: Jodit) { }); if (editor.options.image.editMargins) { - if ((prop.querySelector('.jodit_lock_margin').firstChild).classList.contains('jodit_icon_unlock')) { - $$('.margins', prop).forEach(function () { - css(image, this.id, normalSize(this.value)); + if (!lockMargin) { + $$('.margins', prop).forEach(function (margin) { + css(image, margin.id, normalSize(margin.value)); }); } else { css(image, 'margin', normalSize(val(prop, '#marginTop'))); @@ -567,4 +567,4 @@ export default function (editor: Jodit) { .on('openImageProperties', (image: HTMLImageElement) => { open.call(image); }); -}; \ No newline at end of file +};