mirror of
https://github.com/zen-browser/desktop.git
synced 2026-05-05 05:25:17 +00:00
Fixed switching workspaces
This commit is contained in:
@@ -414,7 +414,7 @@ var gZenVerticalTabsManager = {
|
||||
gBrowser.tabContainer.setAttribute('orient', isVerticalTabs ? 'vertical' : 'horizontal');
|
||||
gBrowser.tabContainer.arrowScrollbox.setAttribute('orient', isVerticalTabs ? 'vertical' : 'horizontal');
|
||||
// on purpose, we set the orient to horizontal, because the arrowScrollbox is vertical
|
||||
gBrowser.tabContainer.arrowScrollbox.scrollbox.setAttribute('orient', isVerticalTabs ? 'horizontal' : 'vertical');
|
||||
gBrowser.tabContainer.arrowScrollbox.scrollbox.setAttribute('orient', (isVerticalTabs && ZenWorkspaces.workspaceEnabled) ? 'horizontal' : 'vertical');
|
||||
|
||||
const buttonsTarget = document.getElementById('zen-sidebar-top-buttons-customization-target');
|
||||
if (isRightSide) {
|
||||
|
||||
@@ -457,6 +457,7 @@
|
||||
max-height: var(--zen-workspace-indicator-height);
|
||||
min-height: var(--zen-workspace-indicator-height);
|
||||
gap: 12px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
flex-direction: row !important;
|
||||
|
||||
@@ -1500,7 +1500,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
}
|
||||
}
|
||||
|
||||
async _animateTabs(newWorkspace, shouldAnimate) {
|
||||
async _animateTabs(newWorkspace, shouldAnimate, tabToSelect = null) {
|
||||
this._animatingChange = true;
|
||||
const animations = [];
|
||||
const workspaces = await this._workspaces();
|
||||
@@ -1534,11 +1534,18 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
}
|
||||
if (offset === 0) {
|
||||
element.setAttribute('active', 'true');
|
||||
if (tabToSelect) {
|
||||
gBrowser.selectedTab = tabToSelect;
|
||||
tabToSelect._visuallySelected = false;
|
||||
}
|
||||
} else {
|
||||
element.removeAttribute('active');
|
||||
}
|
||||
}
|
||||
await Promise.all(animations);
|
||||
if (tabToSelect) {
|
||||
tabToSelect._visuallySelected = false;
|
||||
}
|
||||
this._animatingChange = false;
|
||||
}
|
||||
|
||||
@@ -1618,7 +1625,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
tabToSelect = newTab;
|
||||
}
|
||||
tabToSelect._visuallySelected = true;
|
||||
this._lastSelectedWorkspaceTabs[window.uuid] = tabToSelect;
|
||||
|
||||
// Always make sure we always unselect the tab from the old workspace
|
||||
if (currentSelectedTab && currentSelectedTab !== tabToSelect) {
|
||||
@@ -1641,8 +1647,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
|
||||
gZenThemePicker.onWorkspaceChange(window);
|
||||
|
||||
await this._animateTabs(window, !onInit && !this._animatingChange);
|
||||
gBrowser.selectedTab = tabToSelect;
|
||||
await this._animateTabs(window, !onInit && !this._animatingChange, tabToSelect);
|
||||
|
||||
// Notify listeners
|
||||
if (this._changeListeners?.length) {
|
||||
|
||||
Reference in New Issue
Block a user