Skip to content

Commit

Permalink
[FIX] web_editor: disable command hints on navigation items
Browse files Browse the repository at this point in the history
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#78937

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
  • Loading branch information
bso-odoo committed Jan 13, 2022
1 parent f045d47 commit e0cc23b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions addons/web_editor/static/src/js/wysiwyg/wysiwyg.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit e0cc23b

Please sign in to comment.