From 926cdda3effdf1e4f4e74eb6b221ce7144b2fac5 Mon Sep 17 00:00:00 2001 From: utag-odoo Date: Tue, 4 Jul 2023 18:18:02 +0530 Subject: [PATCH] [FIX] web_editor: fix overlay hidden after image cropping Steps to reproduce: 1. Go to the website 2. Drag a snippet that contains an image 3. Select the image block 4. Go to customize the image 5. Go to transform - select crop image 6. Crop and apply changes -> Overlay is hidden Before this commit, after cropping an image the overlay was hidden. To make the overlay visible again, you have to click elsewhere on the snippet and then click on the image again, because the overlay was being hidden. When we perform an image crop, we activate the `hide_overlay` action, which subsequently eliminates the `o_we_overlay_preview` class. This is due to the fact that, during the image-cropping process, the `previewMode` is set to `false.` However, if we wish to keep the overlay visible, We can simply avoid triggering the "hide_overlay" action. task-3392225 closes odoo/odoo#157635 X-original-commit: 2075b4c957a8e2d03fcfd8bfab99be1e49c31ca9 Signed-off-by: Quentin Smetz (qsm) --- addons/web_editor/static/src/js/editor/snippets.options.js | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js index 738a250f384..2f077a90135 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -6523,7 +6523,6 @@ registry.ImageTools = ImageHandlerOption.extend({ * @see this.selectClass for parameters */ async crop() { - this.trigger_up('hide_overlay'); this.trigger_up('disable_loading_effect'); const img = this._getImg(); const document = this.$el[0].ownerDocument;