fix(ZenCompactMode): refactor URL height recalculation to use dedicated method in ZenVerticalTabsManager

This commit is contained in:
mr. m
2025-04-13 17:52:45 +02:00
parent ad38e6c15e
commit 5a2b469e8a
2 changed files with 15 additions and 11 deletions

View File

@@ -464,6 +464,19 @@ var gZenVerticalTabsManager = {
}
},
recalculateURLBarHeight() {
document.getElementById('urlbar').removeAttribute('--urlbar-height');
if (!this._hasSetSingleToolbar) {
document.getElementById('urlbar').style.setProperty('--urlbar-height', '32px');
} else {
try {
gURLBar.zenUpdateLayoutBreakout();
} catch (e) {
console.error(e);
}
}
},
_updateEvent({ forCustomizableMode = false, dontRebuildAreas = false } = {}) {
if (this._isUpdating) {
return;
@@ -642,16 +655,7 @@ var gZenVerticalTabsManager = {
}
gZenCompactModeManager.updateCompactModeContext(isSingleToolbar);
document.getElementById('urlbar').removeAttribute('--urlbar-height');
if (!isSingleToolbar) {
document.getElementById('urlbar').style.setProperty('--urlbar-height', '32px');
} else {
try {
gURLBar.zenUpdateLayoutBreakout();
} catch (e) {
console.error(e);
}
}
this.recalculateURLBarHeight();
// Always move the splitter next to the sidebar
this.navigatorToolbox.after(document.getElementById('zen-sidebar-splitter'));

View File

@@ -97,7 +97,7 @@ var gZenCompactModeManager = {
flashSidebarIfNecessary(aInstant = false) {
// This function is called after exiting DOM fullscreen mode,
// so we do a bit of a hack to re-calculate the URL height
gURLBar.zenUpdateLayoutBreakout();
gZenVerticalTabsManager.recalculateURLBarHeight();
if (!aInstant && this.preference && lazyCompactMode.COMPACT_MODE_FLASH_ENABLED && !gZenGlanceManager._animating) {
this.flashSidebar();
}