mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-05 09:26:34 +00:00
Update split view logic to check for 'zen-essential' attribute instead of pinned tabs
This commit is contained in:
@@ -1359,8 +1359,7 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
|
|||||||
* @returns {TabGroup} The tab group for split view tabs
|
* @returns {TabGroup} The tab group for split view tabs
|
||||||
*/
|
*/
|
||||||
_getSplitViewGroup(tabs) {
|
_getSplitViewGroup(tabs) {
|
||||||
// if any of tabs is pinned, return null
|
if (tabs.some((tab) => tab.hasAttribute('zen-essential'))) {
|
||||||
if (tabs.some((tab) => tab.pinned)) {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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 628aa6596627c85efe361fc1ece8fd58f7ee653e..490762fa04b9d37d8d7dee3e8dc22e220fe02955 100644
|
index 628aa6596627c85efe361fc1ece8fd58f7ee653e..fe746cd0e749308889173cbbb32b8a77a1dfe10f 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
|
||||||
@@ -412,11 +412,50 @@
|
@@ -412,11 +412,50 @@
|
||||||
@@ -194,14 +194,19 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..490762fa04b9d37d8d7dee3e8dc22e22
|
|||||||
// Additionally send pinned tab events
|
// Additionally send pinned tab events
|
||||||
if (pinned) {
|
if (pinned) {
|
||||||
this._notifyPinnedStatus(t);
|
this._notifyPinnedStatus(t);
|
||||||
@@ -2918,6 +2982,7 @@
|
@@ -2918,9 +2982,10 @@
|
||||||
id = `${Date.now()}-${Math.round(Math.random() * 100)}`;
|
id = `${Date.now()}-${Math.round(Math.random() * 100)}`;
|
||||||
}
|
}
|
||||||
let group = this._createTabGroup(id, color, false, label);
|
let group = this._createTabGroup(id, color, false, label);
|
||||||
|
- this.tabContainer.insertBefore(
|
||||||
+ group.pinned = tabs.some(tab => tab.pinned);
|
+ group.pinned = tabs.some(tab => tab.pinned);
|
||||||
this.tabContainer.insertBefore(
|
+ (group.pinned ? this.verticalPinnedTabsContainer : this.tabContainer).insertBefore(
|
||||||
group,
|
group,
|
||||||
insertBefore?.group ?? insertBefore
|
- insertBefore?.group ?? insertBefore
|
||||||
|
+ insertBefore?.group ?? tabs[tabs.length - 1].nextElementSibling
|
||||||
|
);
|
||||||
|
group.addTabs(tabs);
|
||||||
|
|
||||||
@@ -3367,6 +3432,24 @@
|
@@ -3367,6 +3432,24 @@
|
||||||
) {
|
) {
|
||||||
tabWasReused = true;
|
tabWasReused = true;
|
||||||
|
Reference in New Issue
Block a user