[FIX] web_editor: hide powerbox category name when single one
Powerbox commands are grouped under categories. But this is not very usefull when: - All commands are under of the same category - Each command is under a different category This commit hides the category name when all the commands passed to the powebox are under the same category. In order to avoid the second scenario, the commands array should be passed to `Powerbox.open()` with all commands having the same category name (the name does not matter), or even with `category` undefined. X-original-commit: 93d632861996c78502b33538cc7ff06d8419602c Part-of: odoo/odoo#118204
This commit is contained in:
@@ -209,6 +209,10 @@ export class Powerbox {
|
||||
);
|
||||
}
|
||||
}
|
||||
// Hide category name if there is only a single one.
|
||||
if (this._mainWrapperElement.childElementCount === 1) {
|
||||
this._mainWrapperElement.querySelector('.oe-powerbox-category').style.display = 'none';
|
||||
}
|
||||
this._resetPosition();
|
||||
}
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user