[FIX] web_editor: open the powerbox in mobile
task-2751059 X-original-commit: 86b22141b9653bfad8d135af7f66ff9bc36084ba Part-of: odoo/odoo#88059
This commit is contained in:
@@ -22,7 +22,7 @@ export class Powerbox {
|
||||
this.el.style.width = `${this.options.width}px`;
|
||||
document.body.append(this.el);
|
||||
|
||||
this.addKeydownTrigger('/', { commands: this.options.commands });
|
||||
this.addHotKey('/', { commands: this.options.commands });
|
||||
|
||||
this._mainWrapperElement = document.createElement('div');
|
||||
this._mainWrapperElement.className = 'oe-commandbar-mainWrapper';
|
||||
@@ -140,14 +140,14 @@ export class Powerbox {
|
||||
this._resetPosition();
|
||||
}
|
||||
|
||||
addKeydownTrigger(triggerKey, options) {
|
||||
addHotKey(triggerKey, options) {
|
||||
this.options.editable.addEventListener(
|
||||
'keydown',
|
||||
'input',
|
||||
ev => {
|
||||
const selection = this.options.document.getSelection();
|
||||
if (!selection.isCollapsed || !selection.rangeCount) return;
|
||||
if (
|
||||
ev.key === triggerKey &&
|
||||
ev.data === triggerKey &&
|
||||
!this._active &&
|
||||
(!this.options.shouldActivate || this.options.shouldActivate())
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user