mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 04:29:58 +02:00
Fixed workspace cycling with shortcuts
This commit is contained in:
parent
50afebec5f
commit
cc4f1a3eb2
1 changed files with 2 additions and 9 deletions
|
@ -786,15 +786,8 @@ var ZenWorkspaces = {
|
||||||
let activeWorkspace = workspaces.workspaces.find((workspace) => workspace.used);
|
let activeWorkspace = workspaces.workspaces.find((workspace) => workspace.used);
|
||||||
let workspaceIndex = workspaces.workspaces.indexOf(activeWorkspace);
|
let workspaceIndex = workspaces.workspaces.indexOf(activeWorkspace);
|
||||||
// note: offset can be negative
|
// note: offset can be negative
|
||||||
if (workspaceIndex + offset >= workspaces.workspaces.length) {
|
let nextWorkspace = workspaces.workspaces[(workspaceIndex + offset + workspaces.workspaces.length) % workspaces.workspaces.length];
|
||||||
workspaceIndex = 0;
|
await this.changeWorkspace(nextWorkspace);
|
||||||
} else if (workspaceIndex + offset < 0) {
|
|
||||||
workspaceIndex = workspaces.workspaces.length - 1;
|
|
||||||
} else {
|
|
||||||
workspaceIndex += offset;
|
|
||||||
}
|
|
||||||
let nextWorkspace = workspaces.workspaces[workspaceIndex];
|
|
||||||
this.changeWorkspace(nextWorkspace);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_initializeWorkspaceTabContextMenus() {
|
_initializeWorkspaceTabContextMenus() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue