From ca790367643245d333a444b67c2cddff06964db5 Mon Sep 17 00:00:00 2001 From: Antoine Guenet Date: Fri, 25 Mar 2022 11:41:55 +0000 Subject: [PATCH] [IMP] web_editor: hide the Powerbox when no commands are found When no command is found in the Powerbox, the text "No results" is shown, which is annoying. Instead, this hides the Powerbox we such is the case. task-2802749 Part-of: odoo/odoo#87209 --- .../static/lib/odoo-editor/src/powerbox/Powerbox.js | 8 +------- addons/web_editor/static/lib/odoo-editor/src/style.css | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/addons/web_editor/static/lib/odoo-editor/src/powerbox/Powerbox.js b/addons/web_editor/static/lib/odoo-editor/src/powerbox/Powerbox.js index 7b9814202f6..3cb4c748f67 100644 --- a/addons/web_editor/static/lib/odoo-editor/src/powerbox/Powerbox.js +++ b/addons/web_editor/static/lib/odoo-editor/src/powerbox/Powerbox.js @@ -42,14 +42,8 @@ export class Powerbox { clearTimeout(this._renderingTimeout); this._hoverActive = false; + this._mainWrapperElement.classList.toggle('oe-commandbar-noResult', commands.length === 0); if (commands.length === 0) { - const groupWrapperEl = document.createElement('div'); - groupWrapperEl.className = 'oe-commandbar-groupWrapper'; - const groupNameEl = document.createElement('div'); - groupNameEl.className = 'oe-commandbar-noResult'; - groupWrapperEl.append(groupNameEl); - this._mainWrapperElement.append(groupWrapperEl); - groupNameEl.innerText = this.options._t('No results'); return; } diff --git a/addons/web_editor/static/lib/odoo-editor/src/style.css b/addons/web_editor/static/lib/odoo-editor/src/style.css index f9287625522..44e0fb89c2e 100644 --- a/addons/web_editor/static/lib/odoo-editor/src/style.css +++ b/addons/web_editor/static/lib/odoo-editor/src/style.css @@ -224,7 +224,7 @@ margin: 5px 12px; } .oe-commandbar-noResult { - font-size: 15px; + display: none; } .oe-commandbar-commandWrapper {