mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 01:10:12 +02:00
Refactor ZenKeyboardShortcuts to optimize clearing of main keyset
This commit is contained in:
parent
7b518c9243
commit
2b163c397c
1 changed files with 8 additions and 4 deletions
|
@ -848,7 +848,9 @@ var gZenKeyboardShortcutsManager = {
|
|||
},
|
||||
|
||||
clearMainKeyset(element) {
|
||||
for (let key of element.children) {
|
||||
const children = element.children;
|
||||
for (let i = children.length - 1; i >= 0; i--) {
|
||||
const key = children[i];
|
||||
if (key.getAttribute('internal') == 'true') {
|
||||
continue;
|
||||
}
|
||||
|
@ -957,7 +959,9 @@ var gZenKeyboardShortcutsManager = {
|
|||
};
|
||||
|
||||
document.addEventListener("MozBeforeInitialXULLayout", () => {
|
||||
gZenKeyboardShortcutsManager.beforeInit();
|
||||
// Async init
|
||||
gZenKeyboardShortcutsManager.init();
|
||||
if (Services.prefs.getBoolPref('zen.keyboard.shortcuts.enabled', false)) {
|
||||
gZenKeyboardShortcutsManager.beforeInit();
|
||||
// Async init
|
||||
gZenKeyboardShortcutsManager.init();
|
||||
}
|
||||
}, { once: true });
|
Loading…
Add table
Add a link
Reference in a new issue