mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-09 11:26:44 +00:00
Fixed pinned tabs separator using the wrong tabs when hiding
This commit is contained in:
@@ -126,8 +126,7 @@
|
|||||||
width: 98%;
|
width: 98%;
|
||||||
transition: margin 0.2s ease-in-out, background 0.2s ease-in-out, max-height 0.2s ease-in-out;
|
transition: margin 0.2s ease-in-out, background 0.2s ease-in-out, max-height 0.2s ease-in-out;
|
||||||
|
|
||||||
#vertical-pinned-tabs-container .zen-workspace-tabs-section[active]:not(:has(tab:not([hidden]))) &,
|
#vertical-pinned-tabs-container .zen-workspace-tabs-section[hide-separator] & {
|
||||||
#tabbrowser-tabs:not(:has(#tabbrowser-arrowscrollbox .zen-workspace-tabs-section[active] tab:not([hidden]))) & {
|
|
||||||
max-height: 0;
|
max-height: 0;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
@@ -509,6 +509,8 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
this._initializeWorkspaceTabContextMenus();
|
this._initializeWorkspaceTabContextMenus();
|
||||||
await this.workspaceBookmarks();
|
await this.workspaceBookmarks();
|
||||||
window.addEventListener('TabBrowserInserted', this.onTabBrowserInserted.bind(this));
|
window.addEventListener('TabBrowserInserted', this.onTabBrowserInserted.bind(this));
|
||||||
|
window.addEventListener('TabOpen', this.updateTabsContainers.bind(this));
|
||||||
|
window.addEventListener('TabClose', this.updateTabsContainers.bind(this));
|
||||||
let workspaces = await this._workspaces();
|
let workspaces = await this._workspaces();
|
||||||
let activeWorkspace = null;
|
let activeWorkspace = null;
|
||||||
if (workspaces.workspaces.length === 0) {
|
if (workspaces.workspaces.length === 0) {
|
||||||
@@ -1721,6 +1723,19 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
return workspaceData;
|
return workspaceData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateTabsContainers() {
|
||||||
|
this.onPinnedTabsResize([this.pinnedTabsContainer]);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateShouldHideSeparator(arrowScrollbox, pinnedContainer) {
|
||||||
|
const shouldHideSeparator = pinnedContainer.children.length === 1 || arrowScrollbox.children.length === 1;
|
||||||
|
if (shouldHideSeparator) {
|
||||||
|
pinnedContainer.setAttribute('hide-separator', 'true');
|
||||||
|
} else {
|
||||||
|
pinnedContainer.removeAttribute('hide-separator');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onPinnedTabsResize(entries) {
|
onPinnedTabsResize(entries) {
|
||||||
if (!this.workspaceEnabled) {
|
if (!this.workspaceEnabled) {
|
||||||
return;
|
return;
|
||||||
@@ -1731,6 +1746,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
`#tabbrowser-arrowscrollbox .zen-workspace-tabs-section[zen-workspace-id="${workspaceId}"]`
|
`#tabbrowser-arrowscrollbox .zen-workspace-tabs-section[zen-workspace-id="${workspaceId}"]`
|
||||||
);
|
);
|
||||||
this._updateMarginTopPinnedTabs(arrowScrollbox, entry.target);
|
this._updateMarginTopPinnedTabs(arrowScrollbox, entry.target);
|
||||||
|
this.updateShouldHideSeparator(arrowScrollbox, entry.target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user