mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 00:49: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,10 +348,12 @@ class KeyShortcut {
|
|||
// identify the default keybinds.
|
||||
key.setAttribute('data-l10n-id', this.#l10nId);
|
||||
key.setAttribute('modifiers', this.#modifiers.toString());
|
||||
if (this.#action?.startsWith('code:')) {
|
||||
key.setAttribute('oncommand', this.#action.substring(5));
|
||||
} else {
|
||||
key.setAttribute('command', this.#action);
|
||||
if (this.#action) {
|
||||
if (this.#action?.startsWith('code:')) {
|
||||
key.setAttribute('oncommand', this.#action.substring(5));
|
||||
} else {
|
||||
key.setAttribute('command', this.#action);
|
||||
}
|
||||
}
|
||||
key.setAttribute('disabled', this.#disabled);
|
||||
key.setAttribute('reserved', this.#reserved);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue