mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-17 15:21:53 +00:00
feat: Prevent flashing when cancelling new split view creation, b=no-bug, c=split-view
This commit is contained in:
@@ -212,6 +212,7 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature {
|
|||||||
this.removeGroup(groupIndex);
|
this.removeGroup(groupIndex);
|
||||||
if (changeTab) {
|
if (changeTab) {
|
||||||
gBrowser.selectedTab = remainingTabs[remainingTabs.length - 1];
|
gBrowser.selectedTab = remainingTabs[remainingTabs.length - 1];
|
||||||
|
document.getElementById('cmd_zenNewEmptySplit').removeAttribute('disabled');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const node = this.getSplitNodeFromTab(tab);
|
const node = this.getSplitNodeFromTab(tab);
|
||||||
@@ -1950,7 +1951,7 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature {
|
|||||||
const groupIndex = this._data.findIndex((group) => group.tabs.includes(emptyTab));
|
const groupIndex = this._data.findIndex((group) => group.tabs.includes(emptyTab));
|
||||||
const newSelectedTab = gBrowser.selectedTab;
|
const newSelectedTab = gBrowser.selectedTab;
|
||||||
const cleanup = () => {
|
const cleanup = () => {
|
||||||
this.removeTabFromGroup(emptyTab, groupIndex, { changeTab: false });
|
this.removeTabFromGroup(emptyTab, groupIndex, { changeTab: !onSwitch });
|
||||||
const command = document.getElementById('cmd_zenNewEmptySplit');
|
const command = document.getElementById('cmd_zenNewEmptySplit');
|
||||||
command.removeAttribute('disabled');
|
command.removeAttribute('disabled');
|
||||||
};
|
};
|
||||||
@@ -1969,9 +1970,6 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature {
|
|||||||
this.resetTabState(emptyTab, false);
|
this.resetTabState(emptyTab, false);
|
||||||
this.splitTabs([selectedTab, newSelectedTab], 'grid', 1);
|
this.splitTabs([selectedTab, newSelectedTab], 'grid', 1);
|
||||||
} else {
|
} else {
|
||||||
if (!onSwitch) {
|
|
||||||
gBrowser.selectedTab = selectedTab;
|
|
||||||
}
|
|
||||||
cleanup();
|
cleanup();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user