Skip to content

Commit

Permalink
#1999: alt+shift+w closes all main area tabs
Browse files Browse the repository at this point in the history
Signed-off-by: Miro Spönemann <[email protected]>
  • Loading branch information
spoenemann committed Mar 14, 2019
1 parent e73566f commit 67bc2d4
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/core/src/browser/common-frontend-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,19 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
}
});
commandRegistry.registerCommand(CommonCommands.CLOSE_ALL_TABS, {
isEnabled: (event?: Event) => this.findTabBar(event) !== undefined,
isEnabled: (event?: Event) => {
if (event) {
return this.findTabBar(event) !== undefined;
} else {
return this.shell.mainAreaTabBars.find(tb => tb.titles.length > 0) !== undefined;
}
},
execute: (event?: Event) => {
this.shell.closeTabs(this.findTabArea(event)!);
if (event) {
this.shell.closeTabs(this.findTabArea(event)!);
} else {
this.shell.closeTabs('main');
}
}
});
commandRegistry.registerCommand(CommonCommands.COLLAPSE_PANEL, {
Expand Down

0 comments on commit 67bc2d4

Please sign in to comment.