mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-17 15:21:53 +00:00
fix: Fixed broken layout when the reload button doesn't exist, b=closes #10796, c=common
This commit is contained in:
@@ -32,11 +32,11 @@ export var ZenCustomizableUI = new (class {
|
|||||||
|
|
||||||
// We do not have access to the window object here
|
// We do not have access to the window object here
|
||||||
init(window) {
|
init(window) {
|
||||||
this._addSidebarButtons(window);
|
this.#addSidebarButtons(window);
|
||||||
this._hideToolbarButtons(window);
|
this.#modifyToolbarButtons(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
_addSidebarButtons(window) {
|
#addSidebarButtons(window) {
|
||||||
const kDefaultSidebarWidth = '210px';
|
const kDefaultSidebarWidth = '210px';
|
||||||
const toolbox = window.gNavToolbox;
|
const toolbox = window.gNavToolbox;
|
||||||
|
|
||||||
@@ -105,11 +105,11 @@ export var ZenCustomizableUI = new (class {
|
|||||||
elem.setAttribute('removable', 'true');
|
elem.setAttribute('removable', 'true');
|
||||||
}
|
}
|
||||||
|
|
||||||
this._initCreateNewButton(window);
|
this.#initCreateNewButton(window);
|
||||||
this._moveWindowButtons(window);
|
this.#moveWindowButtons(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
_initCreateNewButton(window) {
|
#initCreateNewButton(window) {
|
||||||
const button = window.document.getElementById('zen-create-new-button');
|
const button = window.document.getElementById('zen-create-new-button');
|
||||||
button.addEventListener('command', (event) => {
|
button.addEventListener('command', (event) => {
|
||||||
if (button.hasAttribute('open')) {
|
if (button.hasAttribute('open')) {
|
||||||
@@ -128,7 +128,7 @@ export var ZenCustomizableUI = new (class {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_moveWindowButtons(window) {
|
#moveWindowButtons(window) {
|
||||||
const windowControls = window.document.getElementsByClassName('titlebar-buttonbox-container');
|
const windowControls = window.document.getElementsByClassName('titlebar-buttonbox-container');
|
||||||
const toolboxIcons = window.document.getElementById(
|
const toolboxIcons = window.document.getElementById(
|
||||||
'zen-sidebar-top-buttons-customization-target'
|
'zen-sidebar-top-buttons-customization-target'
|
||||||
@@ -147,7 +147,7 @@ export var ZenCustomizableUI = new (class {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_hideToolbarButtons(window) {
|
#modifyToolbarButtons(window) {
|
||||||
const wrapper = window.document.getElementById('zen-sidebar-foot-buttons');
|
const wrapper = window.document.getElementById('zen-sidebar-foot-buttons');
|
||||||
const elementsToHide = ['new-tab-button'];
|
const elementsToHide = ['new-tab-button'];
|
||||||
for (let id of elementsToHide) {
|
for (let id of elementsToHide) {
|
||||||
@@ -156,6 +156,7 @@ export var ZenCustomizableUI = new (class {
|
|||||||
wrapper.prepend(elem);
|
wrapper.prepend(elem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
window.document.getElementById('stop-reload-button').removeAttribute('overflows');
|
||||||
}
|
}
|
||||||
|
|
||||||
_dispatchResizeEvent(window) {
|
_dispatchResizeEvent(window) {
|
||||||
|
@@ -58,8 +58,6 @@ var gZenUIManager = {
|
|||||||
this.onUrlbarSearchModeChanged.bind(this)
|
this.onUrlbarSearchModeChanged.bind(this)
|
||||||
);
|
);
|
||||||
|
|
||||||
document.getElementById('stop-reload-button').removeAttribute('overflows');
|
|
||||||
|
|
||||||
gZenMediaController.init();
|
gZenMediaController.init();
|
||||||
gZenVerticalTabsManager.init();
|
gZenVerticalTabsManager.init();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user