Enhance window button handling for macOS and update event listener references

This commit is contained in:
mr. M
2024-11-28 01:22:22 +01:00
parent c146fea519
commit 16080cf46d
4 changed files with 17 additions and 9 deletions

View File

@@ -188,7 +188,16 @@ var gZenVerticalTabsManager = {
get actualWindowButtons() {
// we have multiple ".titlebar-buttonbox-container" in the DOM, because of the titlebar
if (!this.__actualWindowButtons) {
this.__actualWindowButtons = document.querySelector('#nav-bar .titlebar-buttonbox-container');
if (window.AppConstants.platform !== 'macosx') {
this.__actualWindowButtons = document.querySelector('#nav-bar .titlebar-buttonbox-container');
} else {
const buttons = document.querySelectorAll('.titlebar-buttonbox-container');
if (buttons.length === 2) {
this.__actualWindowButtons = buttons[1];
} else {
this.__actualWindowButtons = buttons[0];
}
}
}
return this.__actualWindowButtons;
},
@@ -307,7 +316,7 @@ var gZenVerticalTabsManager = {
if (isRightSide) {
document.getElementById('zen-appcontent-navbar-container').prepend(windowButtons);
} else {
navBar.prepend(windowButtons);
topButtons.prepend(windowButtons);
}
}
} else if (!isSingleToolbar && isCompactMode) {