@@ -31,6 +31,7 @@ import {DeleteAction} from './actions/delete';
31
31
import { InsertAction } from './actions/insert' ;
32
32
import { Clipboard } from './actions/clipboard' ;
33
33
import { WorkspaceMovement } from './actions/ws_movement' ;
34
+ import { ExitAction } from './actions/exit' ;
34
35
import { EnterAction } from './actions/enter' ;
35
36
import { DisconnectAction } from './actions/disconnect' ;
36
37
@@ -84,12 +85,15 @@ export class NavigationController {
84
85
this . canCurrentlyEdit . bind ( this ) ,
85
86
) ;
86
87
88
+ exitAction : ExitAction = new ExitAction (
89
+ this . navigation ,
90
+ this . canCurrentlyNavigate . bind ( this ) ,
91
+
87
92
enterAction : EnterAction = new EnterAction (
88
93
this . navigation ,
89
94
this . canCurrentlyEdit . bind ( this ) ,
90
95
) ;
91
96
92
- hasNavigationFocus : boolean = false ;
93
97
navigationFocus : NAVIGATION_FOCUS_MODE = NAVIGATION_FOCUS_MODE . NONE ;
94
98
95
99
/**
@@ -489,26 +493,6 @@ export class NavigationController {
489
493
keyCodes : [ KeyCodes . T ] ,
490
494
} ,
491
495
492
- /** Exit the current location and focus on the workspace. */
493
- exit : {
494
- name : Constants . SHORTCUT_NAMES . EXIT ,
495
- preconditionFn : ( workspace ) => this . canCurrentlyNavigate ( workspace ) ,
496
- callback : ( workspace ) => {
497
- switch ( this . navigation . getState ( workspace ) ) {
498
- case Constants . STATE . FLYOUT :
499
- this . navigation . focusWorkspace ( workspace ) ;
500
- return true ;
501
- case Constants . STATE . TOOLBOX :
502
- this . navigation . focusWorkspace ( workspace ) ;
503
- return true ;
504
- default :
505
- return false ;
506
- }
507
- } ,
508
- keyCodes : [ KeyCodes . ESC ] ,
509
- allowCollision : true ,
510
- } ,
511
-
512
496
/** Announce the current location of the cursor. */
513
497
announceLocation : {
514
498
name : Constants . SHORTCUT_NAMES . ANNOUNCE ,
@@ -655,6 +639,7 @@ export class NavigationController {
655
639
this . deleteAction . install ( ) ;
656
640
this . insertAction . install ( ) ;
657
641
this . workspaceMovement . install ( ) ;
642
+ this . exitAction . install ( ) ;
658
643
this . enterAction . install ( ) ;
659
644
this . disconnectAction . install ( ) ;
660
645
@@ -680,6 +665,7 @@ export class NavigationController {
680
665
this . disconnectAction . uninstall ( ) ;
681
666
this . clipboard . uninstall ( ) ;
682
667
this . workspaceMovement . uninstall ( ) ;
668
+ this . exitAction . uninstall ( ) ;
683
669
this . enterAction . uninstall ( ) ;
684
670
this . shortcutDialog . uninstall ( ) ;
685
671
0 commit comments