mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
fix(ZenCompactMode): refactor URL height recalculation to use dedicated method in ZenVerticalTabsManager
This commit is contained in:
@@ -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'));
|
||||
|
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user