@@ -31,6 +31,7 @@ import {DeleteAction} from './actions/delete';
3131import { InsertAction } from './actions/insert' ;
3232import { Clipboard } from './actions/clipboard' ;
3333import { WorkspaceMovement } from './actions/ws_movement' ;
34+ import { ExitAction } from './actions/exit' ;
3435import { EnterAction } from './actions/enter' ;
3536import { DisconnectAction } from './actions/disconnect' ;
3637
@@ -84,12 +85,15 @@ export class NavigationController {
8485 this . canCurrentlyEdit . bind ( this ) ,
8586 ) ;
8687
88+ exitAction : ExitAction = new ExitAction (
89+ this . navigation ,
90+ this . canCurrentlyNavigate . bind ( this ) ,
91+
8792 enterAction : EnterAction = new EnterAction (
8893 this . navigation ,
8994 this . canCurrentlyEdit . bind ( this ) ,
9095 ) ;
9196
92- hasNavigationFocus : boolean = false ;
9397 navigationFocus : NAVIGATION_FOCUS_MODE = NAVIGATION_FOCUS_MODE . NONE ;
9498
9599 /**
@@ -489,26 +493,6 @@ export class NavigationController {
489493 keyCodes : [ KeyCodes . T ] ,
490494 } ,
491495
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-
512496 /** Announce the current location of the cursor. */
513497 announceLocation : {
514498 name : Constants . SHORTCUT_NAMES . ANNOUNCE ,
@@ -655,6 +639,7 @@ export class NavigationController {
655639 this . deleteAction . install ( ) ;
656640 this . insertAction . install ( ) ;
657641 this . workspaceMovement . install ( ) ;
642+ this . exitAction . install ( ) ;
658643 this . enterAction . install ( ) ;
659644 this . disconnectAction . install ( ) ;
660645
@@ -680,6 +665,7 @@ export class NavigationController {
680665 this . disconnectAction . uninstall ( ) ;
681666 this . clipboard . uninstall ( ) ;
682667 this . workspaceMovement . uninstall ( ) ;
668+ this . exitAction . uninstall ( ) ;
683669 this . enterAction . uninstall ( ) ;
684670 this . shortcutDialog . uninstall ( ) ;
685671
0 commit comments