From 40a06bfafa94e2a633b57ee0e11ad873b70c75fd Mon Sep 17 00:00:00 2001 From: Younn Olivier Date: Fri, 3 Dec 2021 11:38:53 +0000 Subject: [PATCH] [FIX] web_editor: do not toggle link tools/popover for extra menu items [1] changed the event listener to toggle the link tools and the popover on links from mousedown to click. Before that, when clicking on the extra menu items toggle, the mousedown target was most of the time the icon, so the link tools and the popover were not initialized. Now, as we listen for the click event, the target is the element, for which the tools and the popover are initialized. It should not be the case, as this is a technical element that the user has no control over. task-2513588 [1]: add3e05840869d4a885ca18a2bbabfcb61c7a83d X-original-commit: f1f40517be9280c6f770a116e6909a6d147a3e43 Part-of: odoo/odoo#81351 --- addons/web_editor/static/src/js/wysiwyg/wysiwyg.js | 6 +++++- 1 file changed, 5 insertions(+), 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 2f1a60a02a7..0a90e71842d 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -243,7 +243,11 @@ const Wysiwyg = Widget.extend({ ev.preventDefault(); } - if ($target.is(this.customizableLinksSelector) && $target.is('a') && !$target.attr('data-oe-model') && !$target.find('> [data-oe-model]').length) { + if ($target.is(this.customizableLinksSelector) + && $target.is('a') + && !$target.attr('data-oe-model') + && !$target.find('> [data-oe-model]').length + && !$target[0].closest('.o_extra_menu_items')) { this.linkPopover = $target.data('popover-widget-initialized'); if (!this.linkPopover) { // TODO this code is ugly maybe the mutex should be in the