|
@@ -254,33 +254,37 @@ function addCommands(app: JupyterLab, palette: ICommandPalette): void {
|
|
|
|
|
|
command = CommandIDs.toggleLeftArea;
|
|
command = CommandIDs.toggleLeftArea;
|
|
app.commands.addCommand(command, {
|
|
app.commands.addCommand(command, {
|
|
- label: 'Show Left Area',
|
|
|
|
|
|
+ label: args => args['isPalette'] ?
|
|
|
|
+ 'Toggle Left Area' : 'Show Left Area',
|
|
execute: () => {
|
|
execute: () => {
|
|
if (app.shell.leftCollapsed) {
|
|
if (app.shell.leftCollapsed) {
|
|
app.shell.expandLeft();
|
|
app.shell.expandLeft();
|
|
} else {
|
|
} else {
|
|
app.shell.collapseLeft();
|
|
app.shell.collapseLeft();
|
|
|
|
+ app.shell.activateById(app.shell.currentWidget.id);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
isToggled: () => !app.shell.leftCollapsed,
|
|
isToggled: () => !app.shell.leftCollapsed,
|
|
isVisible: () => !app.shell.isEmpty('left')
|
|
isVisible: () => !app.shell.isEmpty('left')
|
|
});
|
|
});
|
|
- palette.addItem({ command, category });
|
|
|
|
|
|
+ palette.addItem({ command, category, args: { 'isPalette': true } });
|
|
|
|
|
|
command = CommandIDs.toggleRightArea;
|
|
command = CommandIDs.toggleRightArea;
|
|
app.commands.addCommand(command, {
|
|
app.commands.addCommand(command, {
|
|
- label: 'Show Right Area',
|
|
|
|
|
|
+ label: args => args['isPalette'] ?
|
|
|
|
+ 'Toggle Right Area' : 'Show Right Area',
|
|
execute: () => {
|
|
execute: () => {
|
|
if (app.shell.rightCollapsed) {
|
|
if (app.shell.rightCollapsed) {
|
|
app.shell.expandRight();
|
|
app.shell.expandRight();
|
|
} else {
|
|
} else {
|
|
app.shell.collapseRight();
|
|
app.shell.collapseRight();
|
|
|
|
+ app.shell.activateById(app.shell.currentWidget.id);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
isToggled: () => !app.shell.rightCollapsed,
|
|
isToggled: () => !app.shell.rightCollapsed,
|
|
isVisible: () => !app.shell.isEmpty('right')
|
|
isVisible: () => !app.shell.isEmpty('right')
|
|
});
|
|
});
|
|
- palette.addItem({ command, category });
|
|
|
|
|
|
+ palette.addItem({ command, category, args: { 'isPalette': true } });
|
|
|
|
|
|
command = CommandIDs.togglePresentationMode;
|
|
command = CommandIDs.togglePresentationMode;
|
|
app.commands.addCommand(command, {
|
|
app.commands.addCommand(command, {
|