File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -342,10 +342,12 @@ export class DynamicMenuWidget extends MenuWidget {
342342
343343 } else if ( CommandMenu . is ( node ) ) {
344344 const id = ! phCommandRegistry . hasCommand ( node . id ) ? node . id : `${ node . id } :${ DynamicMenuWidget . nextCommmandId ++ } ` ;
345+ const enabled = node . isEnabled ( nodePath , ...( this . args || [ ] ) ) ;
346+ const toggled = node . isToggled ? ! ! node . isToggled ( nodePath , ...( this . args || [ ] ) ) : false ;
345347 phCommandRegistry . addCommand ( id , {
346348 execute : ( ) => { node . run ( nodePath , ...( this . args || [ ] ) ) ; } ,
347- isEnabled : ( ) => node . isEnabled ( nodePath , ... ( this . args || [ ] ) ) ,
348- isToggled : ( ) => node . isToggled ? ! ! node . isToggled ( nodePath , ... ( this . args || [ ] ) ) : false ,
349+ isEnabled : ( ) => enabled ,
350+ isToggled : ( ) => toggled ,
349351 isVisible : ( ) => true ,
350352 label : node . label ,
351353 iconClass : node . icon ,
You can’t perform that action at this time.
0 commit comments