From 55cd20db47332b8b7dfa24aae723ac4cbf4339af Mon Sep 17 00:00:00 2001 From: Nicolas Bayet Date: Mon, 15 Nov 2021 10:13:45 +0000 Subject: [PATCH] [FIX] web_editor: not override root on website Before this commit, if the editor was initiated as a simple editor rather than the website editor (eg. the editor in the forum or profile) the $root of the wysiwyg was wrongly assigned to #wrapwrap rather than the $editable. Subsequent binding (eg. LinkPopover) was bound to too many elements which generated incorrect behaviors (eg, link popover on triggered on every links). Task-2691117 closes odoo/odoo#79810 X-original-commit: 58c1b04de1ec9179b940ee930984a232bb5de30d Signed-off-by: David Monjoie (dmo) --- addons/web_editor/static/src/js/wysiwyg/wysiwyg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index cd5eac5ce62..ad467c39202 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -128,7 +128,7 @@ const Wysiwyg = Widget.extend({ const $wrapwrap = $('#wrapwrap'); if ($wrapwrap.length) { $wrapwrap[0].addEventListener('scroll', this.odooEditor.multiselectionRefresh, { passive: true }); - this.$root = $wrapwrap; + this.$root = this.$root || $wrapwrap; } if (this._peerToPeerLoading) {