mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 15:20:00 +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) {
|
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') {
|
if (key.getAttribute('internal') == 'true') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -957,7 +959,9 @@ var gZenKeyboardShortcutsManager = {
|
||||||
};
|
};
|
||||||
|
|
||||||
document.addEventListener("MozBeforeInitialXULLayout", () => {
|
document.addEventListener("MozBeforeInitialXULLayout", () => {
|
||||||
|
if (Services.prefs.getBoolPref('zen.keyboard.shortcuts.enabled', false)) {
|
||||||
gZenKeyboardShortcutsManager.beforeInit();
|
gZenKeyboardShortcutsManager.beforeInit();
|
||||||
// Async init
|
// Async init
|
||||||
gZenKeyboardShortcutsManager.init();
|
gZenKeyboardShortcutsManager.init();
|
||||||
|
}
|
||||||
}, { once: true });
|
}, { once: true });
|
Loading…
Add table
Add a link
Reference in a new issue