From 784c10aec9d70cb3aeecf4f989f64937f0cdb28e Mon Sep 17 00:00:00 2001 From: Anton Date: Mon, 1 Aug 2022 13:32:55 +0200 Subject: [PATCH] Fix image editor callback after save image [SCI-7019] --- app/assets/javascripts/sitewide/image_editor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/sitewide/image_editor.js b/app/assets/javascripts/sitewide/image_editor.js index 58bd0061f..b451b5a54 100644 --- a/app/assets/javascripts/sitewide/image_editor.js +++ b/app/assets/javascripts/sitewide/image_editor.js @@ -364,7 +364,8 @@ var ImageEditorModal = (function() { contentType: false, processData: false, success: function(res) { - $(`.asset[data-asset-id=${data.id}]`).replaceWith(res.html); + $(`.asset[data-asset-id=${data.id}] .image-container img`).replaceWith($(res.html).find('.image-container img')); + $(`.asset[data-asset-id=${data.id}] .attachment-preview img`).replaceWith($(res.html).find('attachment-preview img')); $(`.asset[data-asset-id=${data.id}]`).closest('.attachments').trigger('reorder'); closeEditor(); }