From bb015c4bdb1c08d5083e2001bf36e2430b6ad529 Mon Sep 17 00:00:00 2001 From: Benoit Socias Date: Mon, 25 Oct 2021 14:06:03 +0000 Subject: [PATCH] [FIX] web_editor: disable command hints on navigation items Before this commit a "List" command hint was set as placeholder in navigation items without content upon selection of the header menu. This showed up when using the sidebar template of the header menu. After this commit the command hints are blacklisted for nav-items in website. task-2677310 closes odoo/odoo#82693 X-original-commit: e0cc23b44d798a5bf79d3e8f7e183f5e8a3c6901 Signed-off-by: David Monjoie (dmo) --- addons/web_editor/static/src/js/wysiwyg/wysiwyg.js | 8 ++++++-- 1 file changed, 6 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 6f4f5522788..b0549267710 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -116,8 +116,12 @@ const Wysiwyg = Widget.extend({ } }, isHintBlacklisted: node => { - return node.hasAttribute && - (node.hasAttribute('data-target') || node.hasAttribute('data-oe-model')); + return (node.classList && node.classList.contains('nav-item')) || ( + node.hasAttribute && ( + node.hasAttribute('data-target') || + node.hasAttribute('data-oe-model') + ) + ); }, filterMutationRecords: (records) => { return records.filter((record) => {