mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 19:29:58 +02:00
Refactor ZenKeyboardShortcuts to handle key actions gracefully
This commit is contained in:
parent
4fcc367d75
commit
160e85f337
1 changed files with 6 additions and 4 deletions
|
@ -348,11 +348,13 @@ class KeyShortcut {
|
||||||
// identify the default keybinds.
|
// identify the default keybinds.
|
||||||
key.setAttribute('data-l10n-id', this.#l10nId);
|
key.setAttribute('data-l10n-id', this.#l10nId);
|
||||||
key.setAttribute('modifiers', this.#modifiers.toString());
|
key.setAttribute('modifiers', this.#modifiers.toString());
|
||||||
|
if (this.#action) {
|
||||||
if (this.#action?.startsWith('code:')) {
|
if (this.#action?.startsWith('code:')) {
|
||||||
key.setAttribute('oncommand', this.#action.substring(5));
|
key.setAttribute('oncommand', this.#action.substring(5));
|
||||||
} else {
|
} else {
|
||||||
key.setAttribute('command', this.#action);
|
key.setAttribute('command', this.#action);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
key.setAttribute('disabled', this.#disabled);
|
key.setAttribute('disabled', this.#disabled);
|
||||||
key.setAttribute('reserved', this.#reserved);
|
key.setAttribute('reserved', this.#reserved);
|
||||||
key.setAttribute('internal', this.#internal);
|
key.setAttribute('internal', this.#internal);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue