From 78b7e9cca968b3fc96ec167af92e9b895128d591 Mon Sep 17 00:00:00 2001 From: vishal padhiyar Date: Tue, 21 Feb 2023 05:16:34 +0000 Subject: [PATCH] [FIX] web_editor: image cropping gives traceback Before this commit: The traceback appears after cropping an image and then trying to crop it again. After this commit: Cropping an image and then cropping it again won't give us tracebacks anymore. Task-3134764 closes odoo/odoo#116262 X-original-commit: 83cf218b131c47b711327a224b0a0fd81406e8c3 Signed-off-by: David Monjoie (dmo) --- addons/web_editor/static/src/js/wysiwyg/wysiwyg.js | 2 +- addons/web_editor/static/src/scss/wysiwyg.scss | 1 + addons/web_editor/static/src/xml/wysiwyg.xml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index d3abc556786..50e1532c330 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -2461,7 +2461,7 @@ const Wysiwyg = Widget.extend({ this.$editable.find('.o_editable_date_field_linked').removeClass('o_editable_date_field_linked'); } const closestDialog = e.target.closest('.o_dialog, .o_web_editor_dialog'); - if (e.target.closest('.oe-toolbar') || (closestDialog && closestDialog.querySelector('.o_select_media_dialog, .o_link_dialog'))) { + if (e.target.closest('.oe-toolbar') || e.target.closest('.o_we_crop_buttons') || (closestDialog && closestDialog.querySelector('.o_select_media_dialog, .o_link_dialog'))) { this._shouldDelayBlur = true; } else { if (this._pendingBlur && !e.target.closest('.o_wysiwyg_wrapper')) { diff --git a/addons/web_editor/static/src/scss/wysiwyg.scss b/addons/web_editor/static/src/scss/wysiwyg.scss index 43859847de8..f6f00ce4889 100644 --- a/addons/web_editor/static/src/scss/wysiwyg.scss +++ b/addons/web_editor/static/src/scss/wysiwyg.scss @@ -613,6 +613,7 @@ img.o_we_selected_image { margin-top: 0.5rem; display: flex; flex-wrap: wrap; + bottom: 1rem; input[type=radio] { display: none; diff --git a/addons/web_editor/static/src/xml/wysiwyg.xml b/addons/web_editor/static/src/xml/wysiwyg.xml index 25ee17cb114..b6920dab952 100644 --- a/addons/web_editor/static/src/xml/wysiwyg.xml +++ b/addons/web_editor/static/src/xml/wysiwyg.xml @@ -339,7 +339,7 @@
-
+