mirror of
https://github.com/zen-browser/desktop.git
synced 2026-09-18 10:44:46 +00:00
gh-15419: Fix overflow-extension order in single toolbar mode (gh-15420)
This commit is contained in:
@@ -1404,18 +1404,37 @@ window.gZenVerticalTabsManager = {
|
||||
|
||||
if (isSingleToolbar) {
|
||||
this._navbarParent = navBar.parentElement;
|
||||
let elements = document.querySelectorAll(
|
||||
'#nav-bar-customization-target > :is([cui-areatype="toolbar"], .chromeclass-toolbar-additional):not(#urlbar-container):not(toolbarspring)'
|
||||
let elements = Array.from(
|
||||
document.querySelectorAll(
|
||||
'#nav-bar-customization-target > :is([cui-areatype="toolbar"], .chromeclass-toolbar-additional):not(#urlbar-container):not(toolbarspring)'
|
||||
)
|
||||
);
|
||||
elements = Array.from(elements).reverse();
|
||||
let normalButtons = [];
|
||||
let extensionButtons = [];
|
||||
for (const element of elements) {
|
||||
if (
|
||||
element.hasAttribute("data-extensionid") &&
|
||||
Services.prefs.getBoolPref("zen.view.overflow-webext-toolbar", true)
|
||||
) {
|
||||
extensionButtons.push(element);
|
||||
} else {
|
||||
normalButtons.push(element);
|
||||
}
|
||||
}
|
||||
// Add separator if it doesn't exist
|
||||
if (!this._hasSetSingleToolbar) {
|
||||
buttonsTarget.append(this._topButtonsSeparatorElement);
|
||||
}
|
||||
this._hasSetSingleToolbar = true;
|
||||
for (const button of elements) {
|
||||
for (const button of normalButtons.reverse()) {
|
||||
this.appendCustomizableItem(this._topButtonsSeparatorElement, button);
|
||||
}
|
||||
for (const extension of extensionButtons) {
|
||||
this.appendCustomizableItem(
|
||||
this._topButtonsSeparatorElement,
|
||||
extension
|
||||
);
|
||||
}
|
||||
buttonsTarget.prepend(
|
||||
document.getElementById("unified-extensions-button")
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user