mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 04:09:59 +02:00
Refactor tab navigation logic in ZenWorkspaces.mjs
This commit is contained in:
parent
bdcc6a8c97
commit
26173f7cfb
1 changed files with 6 additions and 1 deletions
|
@ -457,7 +457,9 @@ var ZenWorkspaces = {
|
||||||
if ((tab.getAttribute('zen-workspace-id') === window.uuid && !tab.pinned) || !tab.hasAttribute('zen-workspace-id')) {
|
if ((tab.getAttribute('zen-workspace-id') === window.uuid && !tab.pinned) || !tab.hasAttribute('zen-workspace-id')) {
|
||||||
if (!firstTab) {
|
if (!firstTab) {
|
||||||
firstTab = tab;
|
firstTab = tab;
|
||||||
gBrowser.selectedTab = firstTab;
|
} else if (gBrowser.selectedTab === tab) {
|
||||||
|
// If the selected tab is already in the workspace, we don't want to change it
|
||||||
|
firstTab = undefined;
|
||||||
}
|
}
|
||||||
gBrowser.showTab(tab);
|
gBrowser.showTab(tab);
|
||||||
if (!tab.hasAttribute('zen-workspace-id')) {
|
if (!tab.hasAttribute('zen-workspace-id')) {
|
||||||
|
@ -467,6 +469,9 @@ var ZenWorkspaces = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (firstTab) {
|
||||||
|
gBrowser.selectedTab = firstTab;
|
||||||
|
}
|
||||||
if (typeof firstTab === 'undefined' && !onInit) {
|
if (typeof firstTab === 'undefined' && !onInit) {
|
||||||
this._createNewTabForWorkspace(window);
|
this._createNewTabForWorkspace(window);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue