mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
fix: Fixed moving folders to different spaces, b=no-bug, c=folders, workspaces
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
||||
index d80a66a01002e78a9c65545d08fe786328ddf124..e644946134c7e5a4b3232f674880eab596d5fa15 100644
|
||||
index d80a66a01002e78a9c65545d08fe786328ddf124..c5c079ac5218f051407b27c6edbd4ba6fe685e62 100644
|
||||
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
||||
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
||||
@@ -422,15 +422,60 @@
|
||||
@@ -623,11 +623,13 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..e644946134c7e5a4b3232f674880eab5
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -6049,7 +6181,7 @@
|
||||
@@ -6048,8 +6180,8 @@
|
||||
}
|
||||
|
||||
// Don't allow mixing pinned and unpinned tabs.
|
||||
if (this.isTab(element) && element.pinned) {
|
||||
- if (this.isTab(element) && element.pinned) {
|
||||
- tabIndex = Math.min(tabIndex, this.pinnedTabCount - 1);
|
||||
+ if (element.pinned) {
|
||||
+ tabIndex = element.hasAttribute('zen-essential') ? Math.min(tabIndex, this._numZenEssentials - 1) : Math.min(Math.max(tabIndex, this._numZenEssentials), this.pinnedTabCount - 1);
|
||||
} else {
|
||||
tabIndex = Math.max(tabIndex, this.pinnedTabCount);
|
||||
|
@@ -771,7 +771,9 @@
|
||||
}
|
||||
}
|
||||
folder.dispatchEvent(new CustomEvent('ZenFolderChangedWorkspace', { bubbles: true }));
|
||||
gZenWorkspaces.changeWorkspaceWithID(workspaceId);
|
||||
gZenWorkspaces.changeWorkspaceWithID(workspaceId).then(() => {
|
||||
gBrowser.moveTabTo(folder, { elementIndex: gBrowser.pinnedTabCount, forceUngrouped: true });
|
||||
});
|
||||
}
|
||||
|
||||
canDropElement(element, targetElement) {
|
||||
@@ -1306,6 +1308,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (group.activeTabs.length === 0) {
|
||||
group.removeAttribute('has-active');
|
||||
this.updateFolderIcon(group, 'close', false);
|
||||
}
|
||||
|
||||
this.on_TabGroupExpand({ target: group, forExpandVisible: true });
|
||||
|
||||
gBrowser.tabContainer._invalidateCachedVisibleTabs();
|
||||
|
@@ -1541,7 +1541,7 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
|
||||
|
||||
async changeWorkspaceWithID(workspaceID, ...args) {
|
||||
const workspace = this.getWorkspaceFromId(workspaceID);
|
||||
return await this.changeWorkspace(workspace, ...args);
|
||||
await this.changeWorkspace(workspace, ...args);
|
||||
}
|
||||
|
||||
async changeWorkspace(workspace, ...args) {
|
||||
@@ -1624,7 +1624,7 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
|
||||
}
|
||||
|
||||
#fixTabPositions() {
|
||||
gBrowser.tabContainer._invalidateCachedTabs();
|
||||
this.tabContainer._invalidateCachedTabs();
|
||||
// Fix tabs _tPos values relative to the actual order
|
||||
const tabs = gBrowser.tabs;
|
||||
const usedGroups = new Set();
|
||||
|
Reference in New Issue
Block a user