mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-06 03:18:19 +00:00
Fixed reordering tabs with glance and hidden tabs in workspaces
This commit is contained in:
@@ -1809,12 +1809,13 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
// Bug: When updating from previous versions, we used to hide the tabs not used in the new workspace
|
// Bug: When updating from previous versions, we used to hide the tabs not used in the new workspace
|
||||||
// we now need to show them again
|
// we now need to show them again
|
||||||
if (onInit) {
|
if (onInit) {
|
||||||
console.log(this.allStoredTabs);
|
|
||||||
for (const tab of this.allStoredTabs) {
|
for (const tab of this.allStoredTabs) {
|
||||||
|
if (!tab.hasAttribute('zen-essential')) {
|
||||||
gBrowser.showTab(tab);
|
gBrowser.showTab(tab);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async _fixCtrlTabBehavior() {
|
async _fixCtrlTabBehavior() {
|
||||||
ctrlTab.uninit();
|
ctrlTab.uninit();
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..c8fc61c310df678f7a74f4b0fe390bcb07e02291 100644
|
index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..dd8fba935e26aa0f00b687f23b64935dfcf339fa 100644
|
||||||
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
@@ -406,11 +406,50 @@
|
@@ -406,11 +406,50 @@
|
||||||
@@ -413,7 +413,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..c8fc61c310df678f7a74f4b0fe390bcb
|
|||||||
// Don't allow mixing pinned and unpinned tabs.
|
// Don't allow mixing pinned and unpinned tabs.
|
||||||
if (aTab.pinned) {
|
if (aTab.pinned) {
|
||||||
- aIndex = Math.min(aIndex, this.pinnedTabCount - 1);
|
- aIndex = Math.min(aIndex, this.pinnedTabCount - 1);
|
||||||
+ aIndex = aTab.hasAttribute('zen-essential') ? Math.min(aIndex, this._numVisiblePinTabsWithoutGlance) : Math.min(aIndex, this._numVisiblePinTabs);
|
+ aIndex = aTab.hasAttribute('zen-essential') ? Math.min(aIndex, this._numZenEssentials) : Math.min(aIndex, this._numVisiblePinTabs - 1);
|
||||||
} else {
|
} else {
|
||||||
- aIndex = Math.max(aIndex, this.pinnedTabCount);
|
- aIndex = Math.max(aIndex, this.pinnedTabCount);
|
||||||
+ aIndex = Math.max(aIndex, this._numVisiblePinTabsWithoutGlance + this._numZenEssentials);
|
+ aIndex = Math.max(aIndex, this._numVisiblePinTabsWithoutGlance + this._numZenEssentials);
|
||||||
@@ -425,7 +425,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..c8fc61c310df678f7a74f4b0fe390bcb
|
|||||||
|
|
||||||
this._handleTabMove(aTab, () => {
|
this._handleTabMove(aTab, () => {
|
||||||
- let neighbor = this.tabs[aIndex];
|
- let neighbor = this.tabs[aIndex];
|
||||||
+ let neighbor = this.tabs.filter(tab => !tab.hasAttribute("zen-glance-tab"))[aIndex];
|
+ let neighbor = this.tabs.filter(tab => !tab.hasAttribute("zen-glance-tab") && !tab.hasAttribute("zen-empty-tab"))[aIndex];
|
||||||
if (forceStandaloneTab && neighbor.group) {
|
if (forceStandaloneTab && neighbor.group) {
|
||||||
neighbor = neighbor.group;
|
neighbor = neighbor.group;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user