[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
This commit is contained in:
Antoine Guenet
2022-04-07 17:57:23 +02:00
parent c927e4be4a
commit ca79036764
2 changed files with 2 additions and 8 deletions
@@ -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;
}
@@ -224,7 +224,7 @@
margin: 5px 12px;
}
.oe-commandbar-noResult {
font-size: 15px;
display: none;
}
.oe-commandbar-commandWrapper {