File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -1005,7 +1005,17 @@ export function addCommands(
1005
1005
? tracker . currentWidget . model . sharedModel . editable
1006
1006
: false ;
1007
1007
} ,
1008
- execute : async ( ) => await Private . toggleConsole ( tracker )
1008
+ isToggled : ( ) => {
1009
+ if ( tracker . currentWidget instanceof JupyterGISDocumentWidget ) {
1010
+ return tracker . currentWidget ?. content . consoleOpened === true ;
1011
+ } else {
1012
+ return false ;
1013
+ }
1014
+ } ,
1015
+ execute : async ( ) => {
1016
+ await Private . toggleConsole ( tracker ) ;
1017
+ commands . notifyCommandChanged ( CommandIDs . toggleConsole ) ;
1018
+ }
1009
1019
} ) ;
1010
1020
commands . addCommand ( CommandIDs . executeConsole , {
1011
1021
label : trans . __ ( 'Execute console' ) ,
Original file line number Diff line number Diff line change @@ -158,6 +158,10 @@ export class JupyterGISPanel extends SplitPanel {
158
158
return this . _consoleView ?. consolePanel ;
159
159
}
160
160
161
+ get consoleOpened ( ) : boolean {
162
+ return this . _consoleOpened ;
163
+ }
164
+
161
165
executeConsole ( ) {
162
166
if ( this . _consoleView ) {
163
167
this . _consoleView . execute ( ) ;
You can’t perform that action at this time.
0 commit comments