From 6b8bf0dd415c5a8bb446930cb946fb0fd627a604 Mon Sep 17 00:00:00 2001 From: Nicolas Bayet Date: Thu, 24 Mar 2022 09:31:51 +0000 Subject: [PATCH] [FIX] web_editor: prevent opening linktool on uneditable links Before this commit When trying to open the linktool on link that are not `isContentEditable`, the linktool was initialized and not showed in the sidebar. After this commit As it does not make sense to edit a link that is not editable, prevent the linktool from being initialized in the first place. task-2802592 closes odoo/odoo#87203 X-original-commit: 4a634f2c5bfceb3f2dc200f9b391ef1cdbc0e697 Signed-off-by: David Monjoie (dmo) --- addons/web_editor/static/src/js/wysiwyg/wysiwyg.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index 50f5892784f..65fed2e3e23 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -282,6 +282,7 @@ const Wysiwyg = Widget.extend({ if ($target.is(this.customizableLinksSelector) && $target.is('a') + && $target[0].isContentEditable && !$target.attr('data-oe-model') && !$target.find('> [data-oe-model]').length && !$target[0].closest('.o_extra_menu_items')) {