mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 21:19:57 +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 (!firstTab) {
|
||||
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);
|
||||
if (!tab.hasAttribute('zen-workspace-id')) {
|
||||
|
@ -467,6 +469,9 @@ var ZenWorkspaces = {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (firstTab) {
|
||||
gBrowser.selectedTab = firstTab;
|
||||
}
|
||||
if (typeof firstTab === 'undefined' && !onInit) {
|
||||
this._createNewTabForWorkspace(window);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue