forked from ZenBrowserMirrors/zen-desktop
fix: prevent pinned tabs from commingling with non-pinned tabs in split view
This commit is contained in:
parent
173242e2bb
commit
20cb086c76
1 changed files with 21 additions and 10 deletions
|
@ -1,5 +1,5 @@
|
|||
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
||||
index 5f406ea5d09273c9b70b84eee24c6267f88692f8..8e3dc2669c57ff59f66bcc0b0c45d9296a455275 100644
|
||||
index 5f406ea5d09273c9b70b84eee24c6267f88692f8..adc4599c4d1722f8a6a0a636bba074a2b4b44527 100644
|
||||
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
||||
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
||||
@@ -424,11 +424,50 @@
|
||||
|
@ -595,7 +595,18 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..8e3dc2669c57ff59f66bcc0b0c45d929
|
|||
neighbor.after(aTab);
|
||||
} else {
|
||||
this.tabContainer.insertBefore(aTab, neighbor);
|
||||
@@ -5908,6 +6061,9 @@
|
||||
@@ -5901,6 +6054,10 @@
|
||||
* Bug 1955388 - prevent pinned tabs from commingling with non-pinned tabs
|
||||
* when there are hidden tabs present
|
||||
*/
|
||||
+ if (targetElement?.group?.hasAttribute("split-view-group")) {
|
||||
+ targetElement = targetElement.group;
|
||||
+ }
|
||||
+
|
||||
if (tab.pinned && !targetElement?.pinned) {
|
||||
// prevent pinned tab from being dragged past a non-pinned tab
|
||||
targetElement = this.tabs[this.pinnedTabCount - 1];
|
||||
@@ -5908,6 +6065,9 @@
|
||||
}
|
||||
|
||||
let getContainer = () => {
|
||||
|
@ -605,7 +616,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..8e3dc2669c57ff59f66bcc0b0c45d929
|
|||
if (tab.pinned && this.tabContainer.verticalMode) {
|
||||
return this.tabContainer.verticalPinnedTabsContainer;
|
||||
}
|
||||
@@ -5937,7 +6093,7 @@
|
||||
@@ -5937,7 +6097,7 @@
|
||||
}
|
||||
|
||||
moveTabToGroup(aTab, aGroup) {
|
||||
|
@ -614,7 +625,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..8e3dc2669c57ff59f66bcc0b0c45d929
|
|||
return;
|
||||
}
|
||||
if (aTab.group && aTab.group.id === aGroup.id) {
|
||||
@@ -5961,6 +6117,10 @@
|
||||
@@ -5961,6 +6121,10 @@
|
||||
|
||||
moveActionCallback();
|
||||
|
||||
|
@ -625,7 +636,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..8e3dc2669c57ff59f66bcc0b0c45d929
|
|||
// Clear tabs cache after moving nodes because the order of tabs may have
|
||||
// changed.
|
||||
this.tabContainer._invalidateCachedTabs();
|
||||
@@ -6015,7 +6175,7 @@
|
||||
@@ -6015,7 +6179,7 @@
|
||||
createLazyBrowser,
|
||||
};
|
||||
|
||||
|
@ -634,7 +645,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..8e3dc2669c57ff59f66bcc0b0c45d929
|
|||
if (aIndex < numPinned || (aTab.pinned && aIndex == numPinned)) {
|
||||
params.pinned = true;
|
||||
}
|
||||
@@ -6765,7 +6925,7 @@
|
||||
@@ -6765,7 +6929,7 @@
|
||||
// preventDefault(). It will still raise the window if appropriate.
|
||||
break;
|
||||
}
|
||||
|
@ -643,7 +654,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..8e3dc2669c57ff59f66bcc0b0c45d929
|
|||
window.focus();
|
||||
aEvent.preventDefault();
|
||||
break;
|
||||
@@ -7671,6 +7831,7 @@
|
||||
@@ -7671,6 +7835,7 @@
|
||||
aWebProgress.isTopLevel
|
||||
) {
|
||||
this.mTab.setAttribute("busy", "true");
|
||||
|
@ -651,7 +662,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..8e3dc2669c57ff59f66bcc0b0c45d929
|
|||
gBrowser._tabAttrModified(this.mTab, ["busy"]);
|
||||
this.mTab._notselectedsinceload = !this.mTab.selected;
|
||||
}
|
||||
@@ -8640,7 +8801,7 @@ var TabContextMenu = {
|
||||
@@ -8640,7 +8805,7 @@ var TabContextMenu = {
|
||||
);
|
||||
contextUnpinSelectedTabs.hidden =
|
||||
!this.contextTab.pinned || !this.multiselected;
|
||||
|
@ -660,7 +671,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..8e3dc2669c57ff59f66bcc0b0c45d929
|
|||
// Move Tab items
|
||||
let contextMoveTabOptions = document.getElementById(
|
||||
"context_moveTabOptions"
|
||||
@@ -8674,7 +8835,7 @@ var TabContextMenu = {
|
||||
@@ -8674,7 +8839,7 @@ var TabContextMenu = {
|
||||
let isFirstTab =
|
||||
!this.contextTabs[0].group &&
|
||||
(this.contextTabs[0] == visibleTabs[0] ||
|
||||
|
@ -669,7 +680,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..8e3dc2669c57ff59f66bcc0b0c45d929
|
|||
contextMoveTabToStart.disabled = isFirstTab && allSelectedTabsAdjacent;
|
||||
|
||||
document.getElementById("context_openTabInWindow").disabled =
|
||||
@@ -8904,6 +9065,7 @@ var TabContextMenu = {
|
||||
@@ -8904,6 +9069,7 @@ var TabContextMenu = {
|
||||
if (this.contextTab.multiselected) {
|
||||
gBrowser.removeMultiSelectedTabs();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue