File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -207,11 +207,23 @@ define([], function() {
207207 that . keyManager . keyCheck . shiftKey = false ;
208208 }
209209 if ( evt . keyCode == that . keyManager . keyCode . escKey ) {
210- // close popup on esc
211- $ ( '#vp_wrapper' ) . trigger ( {
212- type : 'close_option_page' ,
213- component : that . mainFrame . focusedPage
214- } ) ;
210+ // check if there is visible data selector : DataSelector
211+ if ( $ ( '.vp-dataselector-base:visible' ) . length > 0 ) {
212+ // close data selector
213+ $ ( '.vp-dataselector-base:visible' ) . remove ( ) ;
214+ }
215+ // check if there is visible inner popup
216+ else if ( $ ( '.vp-popup-frame > .vp-inner-popup-box:visible' ) . length > 0 ) {
217+ // close inner popup on esc
218+ console . log ( 'close inner popup from this component' , that . mainFrame . focusedPage ) ;
219+ that . mainFrame . focusedPage && that . mainFrame . focusedPage . closeInnerPopup ( ) ;
220+ } else {
221+ // close popup on esc
222+ $ ( '#vp_wrapper' ) . trigger ( {
223+ type : 'close_option_page' ,
224+ component : that . mainFrame . focusedPage
225+ } ) ;
226+ }
215227 }
216228 if ( evt . keyCode == that . keyManager . keyCode . enter ) {
217229 // blur on enter
Original file line number Diff line number Diff line change @@ -403,15 +403,13 @@ define([
403403 } ) ;
404404 // Close event for inner popup
405405 $ ( this . wrapSelector ( '.vp-inner-popup-close' ) ) . on ( 'click' , function ( evt ) {
406- that . handleInnerCancel ( ) ;
407406 that . closeInnerPopup ( ) ;
408407 } ) ;
409408 // Click button event for inner popup
410409 $ ( this . wrapSelector ( '.vp-inner-popup-button' ) ) . on ( 'click' , function ( evt ) {
411410 let btnType = $ ( this ) . data ( 'type' ) ;
412411 switch ( btnType ) {
413412 case 'cancel' :
414- that . handleInnerCancel ( ) ;
415413 that . closeInnerPopup ( ) ;
416414 break ;
417415 case 'ok' :
@@ -480,7 +478,7 @@ define([
480478 template ( ) {
481479 this . $pageDom = $ ( popupComponentHtml ) ;
482480 // set title
483- this . $pageDom . find ( '.vp-popup-title' ) . text ( this . state . config . name ) ;
481+ this . $pageDom . find ( '.vp-popup-title' ) . text ( this . name ) ;
484482 // set body
485483 this . $pageDom . find ( '.vp-popup-content' ) . html ( this . templateForBody ( ) ) ;
486484 return this . $pageDom ;
@@ -848,13 +846,16 @@ define([
848846 $ ( this . wrapSelector ( '.vp-inner-popup-box' ) ) . show ( ) ;
849847
850848 // focus on first input
851- $ ( this . wrapSelector ( '.vp-inner-popup-box input[type=text]:not(:disabled):visible:first' ) ) . focus ( ) ;
849+ $ ( this . wrapSelector ( '.vp-inner-popup-box input:not(:disabled):visible:first' ) ) . focus ( ) ;
850+ // disable Jupyter key
851+ com_interface . disableOtherShortcut ( ) ;
852852 }
853853
854854 /**
855855 * Close inner popup box
856856 */
857857 closeInnerPopup ( ) {
858+ this . handleInnerCancel ( ) ;
858859 $ ( this . wrapSelector ( '.vp-inner-popup-box' ) ) . hide ( ) ;
859860 }
860861
You can’t perform that action at this time.
0 commit comments