mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 21:49:59 +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 workspaceIndex = workspaces.workspaces.indexOf(activeWorkspace);
|
||||
// note: offset can be negative
|
||||
if (workspaceIndex + offset >= workspaces.workspaces.length) {
|
||||
workspaceIndex = 0;
|
||||
} else if (workspaceIndex + offset < 0) {
|
||||
workspaceIndex = workspaces.workspaces.length - 1;
|
||||
} else {
|
||||
workspaceIndex += offset;
|
||||
}
|
||||
let nextWorkspace = workspaces.workspaces[workspaceIndex];
|
||||
this.changeWorkspace(nextWorkspace);
|
||||
let nextWorkspace = workspaces.workspaces[(workspaceIndex + offset + workspaces.workspaces.length) % workspaces.workspaces.length];
|
||||
await this.changeWorkspace(nextWorkspace);
|
||||
},
|
||||
|
||||
_initializeWorkspaceTabContextMenus() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue