mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-03 16:36:35 +00:00
Enhance workspace tab initialization and update tab toolbar on load
This commit is contained in:
@@ -27,6 +27,7 @@ var gZenUIManager = {
|
|||||||
|
|
||||||
SessionStore.promiseAllWindowsRestored.then(() => {
|
SessionStore.promiseAllWindowsRestored.then(() => {
|
||||||
this._hasLoadedDOM = true;
|
this._hasLoadedDOM = true;
|
||||||
|
this.updateTabsToolbar();
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener('TabClose', this.onTabClose.bind(this));
|
window.addEventListener('TabClose', this.onTabClose.bind(this));
|
||||||
|
@@ -148,7 +148,8 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
async initializeTabsStripSections() {
|
async initializeTabsStripSections() {
|
||||||
const perifery = document.getElementById('tabbrowser-arrowscrollbox-periphery');
|
const perifery = document.getElementById('tabbrowser-arrowscrollbox-periphery');
|
||||||
const tabs = gBrowser.tabContainer.allTabs.filter((tab) => !tab.pinned);
|
const tabs = gBrowser.tabContainer.allTabs.filter((tab) => !tab.pinned);
|
||||||
for (const workspace of (await this._workspaces()).workspaces) {
|
const workspaces = await this._workspaces();
|
||||||
|
for (const workspace of workspaces.workspaces) {
|
||||||
this._createWorkspaceTabsSection(workspace, tabs, perifery);
|
this._createWorkspaceTabsSection(workspace, tabs, perifery);
|
||||||
}
|
}
|
||||||
if (tabs.length) {
|
if (tabs.length) {
|
||||||
@@ -164,6 +165,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
perifery.setAttribute('hidden', 'true');
|
perifery.setAttribute('hidden', 'true');
|
||||||
this._hasInitializedTabsStrip = true;
|
this._hasInitializedTabsStrip = true;
|
||||||
this.registerPinnedResizeObserver();
|
this.registerPinnedResizeObserver();
|
||||||
|
this._fixIndicatorsNames(workspaces);
|
||||||
}
|
}
|
||||||
|
|
||||||
_createWorkspaceSection(workspace) {
|
_createWorkspaceSection(workspace) {
|
||||||
@@ -526,6 +528,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
this.activeWorkspace = activeWorkspace?.uuid;
|
this.activeWorkspace = activeWorkspace?.uuid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
await this.initializeTabsStripSections();
|
||||||
try {
|
try {
|
||||||
if (activeWorkspace) {
|
if (activeWorkspace) {
|
||||||
window.gZenThemePicker = new ZenThemePicker();
|
window.gZenThemePicker = new ZenThemePicker();
|
||||||
@@ -534,7 +537,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('ZenWorkspaces: Error initializing theme picker', e);
|
console.error('ZenWorkspaces: Error initializing theme picker', e);
|
||||||
}
|
}
|
||||||
await this.initializeTabsStripSections();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1740,7 +1742,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onPinnedTabsResize(entries) {
|
onPinnedTabsResize(entries) {
|
||||||
if (!this.workspaceEnabled) {
|
if (!this.workspaceEnabled || !this._hasInitializedTabsStrip) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (const entry of entries) {
|
for (const entry of entries) {
|
||||||
|
Reference in New Issue
Block a user