File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed
Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -45,12 +45,23 @@ export class ActionMenu {
4545 private registerShortcut ( ) {
4646 const menuShortcut : ShortcutRegistry . KeyboardShortcut = {
4747 name : Constants . SHORTCUT_NAMES . MENU ,
48- preconditionFn : ( workspace ) =>
49- this . navigation . canCurrentlyNavigate ( workspace ) ,
48+ preconditionFn : ( workspace ) => {
49+ return (
50+ this . navigation . canCurrentlyNavigate ( workspace ) &&
51+ ! workspace . isDragging ( )
52+ ) ;
53+ } ,
5054 callback : ( workspace ) => {
5155 switch ( this . navigation . getState ( workspace ) ) {
5256 case Constants . STATE . WORKSPACE :
5357 return this . openActionMenu ( workspace ) ;
58+ case Constants . STATE . FLYOUT : {
59+ const flyoutWorkspace = workspace . getFlyout ( ) ?. getWorkspace ( ) ;
60+ if ( flyoutWorkspace ) {
61+ return this . openActionMenu ( flyoutWorkspace ) ;
62+ }
63+ return false ;
64+ }
5465 default :
5566 return false ;
5667 }
Original file line number Diff line number Diff line change @@ -99,19 +99,17 @@ export class Navigation {
9999 getState ( workspace : Blockly . WorkspaceSvg ) : Constants . STATE {
100100 const focusedTree = Blockly . getFocusManager ( ) . getFocusedTree ( ) ;
101101 if ( focusedTree instanceof Blockly . WorkspaceSvg ) {
102- if ( focusedTree . isFlyout && workspace === focusedTree . targetWorkspace ) {
102+ if ( focusedTree . isFlyout ) {
103103 return Constants . STATE . FLYOUT ;
104- } else if ( workspace === focusedTree ) {
104+ } else {
105105 return Constants . STATE . WORKSPACE ;
106106 }
107107 } else if ( focusedTree instanceof Blockly . Toolbox ) {
108108 if ( workspace === focusedTree . getWorkspace ( ) ) {
109109 return Constants . STATE . TOOLBOX ;
110110 }
111111 } else if ( focusedTree instanceof Blockly . Flyout ) {
112- if ( workspace === focusedTree . targetWorkspace ) {
113- return Constants . STATE . FLYOUT ;
114- }
112+ return Constants . STATE . FLYOUT ;
115113 }
116114 // Either a non-Blockly element currently has DOM focus, or a different
117115 // workspace holds it.
You can’t perform that action at this time.
0 commit comments