From d10d0b2da4b8f93f6fa79bdfd209ec21c778914f Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Thu, 18 Feb 2021 12:59:28 +0000 Subject: [PATCH] [FIX] web_editor: don't save cropping tool on CTRL+Z Scenario: - start cropping of an image - press TAB key - do CTRL + Z => now the image cropping tool are inside the page and there is no way to remove them. Why: The image crop tool was added inside the editable elemnt, so if we did an action that changed history the cropping tools are saved in the snapshot and going back to it will add them without any code handling their removal. opw-2394877 opw-2423445 closes odoo/odoo#66499 X-original-commit: ce93cbd78e282e6957aaeba6f06945f94bfffb26 Signed-off-by: Nicolas Lempereur (nle) --- addons/web_editor/static/src/js/editor/rte.summernote.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/editor/rte.summernote.js b/addons/web_editor/static/src/js/editor/rte.summernote.js index 4e93ce020d8..43e69805f5d 100644 --- a/addons/web_editor/static/src/js/editor/rte.summernote.js +++ b/addons/web_editor/static/src/js/editor/rte.summernote.js @@ -1208,7 +1208,7 @@ var SummernoteManager = Class.extend(mixins.EventDispatcherMixin, ServicesMixin, } data.__alreadyDone = true; new weWidgets.ImageCropWidget(this, data.media) - .appendTo(data.$editable); + .appendTo(data.$editable.parent()); }, /** * Called when a demand to open a link dialog is received on the bus.