Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion packages/base/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,17 @@ export function addCommands(
? tracker.currentWidget.model.sharedModel.editable
: false;
},
execute: async () => await Private.toggleConsole(tracker)
isToggled: () => {
if (tracker.currentWidget instanceof JupyterGISDocumentWidget) {
return tracker.currentWidget?.content.consoleOpened === true;
} else {
return false;
}
},
execute: async () => {
await Private.toggleConsole(tracker);
commands.notifyCommandChanged(CommandIDs.toggleConsole);
}
});
commands.addCommand(CommandIDs.executeConsole, {
label: trans.__('Execute console'),
Expand Down
4 changes: 4 additions & 0 deletions packages/base/src/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ export class JupyterGISPanel extends SplitPanel {
return this._consoleView?.consolePanel;
}

get consoleOpened(): boolean {
return this._consoleOpened;
}

executeConsole() {
if (this._consoleView) {
this._consoleView.execute();
Expand Down
Loading