mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-29 14:38:37 +00:00
Refactor initialization logic in ZenStartup and update tab toolbar handling in ZenUIManager and ZenPinnedTabManager
This commit is contained in:
@@ -3,11 +3,9 @@
|
||||
var ZenStartup = {
|
||||
init() {
|
||||
this.openWatermark();
|
||||
window.SessionStore.promiseInitialized.then(() => {
|
||||
this._changeSidebarLocation();
|
||||
this._zenInitBrowserLayout();
|
||||
this._initSearchBar();
|
||||
});
|
||||
this._changeSidebarLocation();
|
||||
this._zenInitBrowserLayout();
|
||||
this._initSearchBar();
|
||||
},
|
||||
|
||||
_zenInitBrowserLayout() {
|
||||
|
@@ -14,7 +14,7 @@ var gZenUIManager = {
|
||||
return ChromeUtils.importESModule('chrome://browser/content/zen-vendor/motion.min.mjs', { global: 'current' });
|
||||
});
|
||||
|
||||
new ResizeObserver(gZenCommonActions.throttle(this.updateTabsToolbar.bind(this), this.sidebarHeightThrottle)).observe(
|
||||
new ResizeObserver(this.updateTabsToolbar.bind(this)).observe(
|
||||
document.getElementById('TabsToolbar')
|
||||
);
|
||||
|
||||
@@ -241,7 +241,7 @@ var gZenVerticalTabsManager = {
|
||||
window.addEventListener('customizationstarting', this._preCustomize.bind(this));
|
||||
window.addEventListener('aftercustomization', this._postCustomize.bind(this));
|
||||
|
||||
window.addEventListener('MozAfterPaint', updateEvent, { once: true });
|
||||
this._updateEvent();
|
||||
|
||||
if (!this.isWindowsStyledButtons) {
|
||||
document.documentElement.setAttribute('zen-window-buttons-reversed', true);
|
||||
@@ -570,6 +570,7 @@ var gZenVerticalTabsManager = {
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
gZenUIManager.updateTabsToolbar();
|
||||
this._isUpdating = false;
|
||||
},
|
||||
|
||||
|
@@ -249,6 +249,7 @@
|
||||
}
|
||||
|
||||
gBrowser._updateTabBarForPinnedTabs();
|
||||
gZenUIManager.updateTabsToolbar();
|
||||
}
|
||||
|
||||
_onPinnedTabEvent(action, event) {
|
||||
|
@@ -232,6 +232,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
_organizeTabsToWorkspaceSections(workspace, section, pinnedSection, tabs) {
|
||||
const workspaceTabs = Array.from(tabs).filter((tab) => tab.getAttribute('zen-workspace-id') === workspace.uuid);
|
||||
for (const tab of workspaceTabs) {
|
||||
if (tab.hasAttribute('zen-essential')) {
|
||||
continue; // Ignore essentials as they need to be in their own section
|
||||
}
|
||||
// remove tab from list
|
||||
tabs.splice(tabs.indexOf(tab), 1);
|
||||
if (tab.pinned) {
|
||||
|
Reference in New Issue
Block a user