Skip to content
Snippets Groups Projects
Commit 378e9de9 authored by Nicolas Bayet's avatar Nicolas Bayet
Browse files

[FIX] web_editor: open the powerbox in mobile

task-2751059

X-original-commit: 86b22141b9653bfad8d135af7f66ff9bc36084ba
Part-of: odoo/odoo#88059
parent 8b918e95
No related branches found
No related tags found
No related merge requests found
......@@ -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())
) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment