File tree 2 files changed +22
-9
lines changed 2 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -207,11 +207,23 @@ define([], function() {
207
207
that . keyManager . keyCheck . shiftKey = false ;
208
208
}
209
209
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
+ }
215
227
}
216
228
if ( evt . keyCode == that . keyManager . keyCode . enter ) {
217
229
// blur on enter
Original file line number Diff line number Diff line change @@ -403,15 +403,13 @@ define([
403
403
} ) ;
404
404
// Close event for inner popup
405
405
$ ( this . wrapSelector ( '.vp-inner-popup-close' ) ) . on ( 'click' , function ( evt ) {
406
- that . handleInnerCancel ( ) ;
407
406
that . closeInnerPopup ( ) ;
408
407
} ) ;
409
408
// Click button event for inner popup
410
409
$ ( this . wrapSelector ( '.vp-inner-popup-button' ) ) . on ( 'click' , function ( evt ) {
411
410
let btnType = $ ( this ) . data ( 'type' ) ;
412
411
switch ( btnType ) {
413
412
case 'cancel' :
414
- that . handleInnerCancel ( ) ;
415
413
that . closeInnerPopup ( ) ;
416
414
break ;
417
415
case 'ok' :
@@ -480,7 +478,7 @@ define([
480
478
template ( ) {
481
479
this . $pageDom = $ ( popupComponentHtml ) ;
482
480
// set title
483
- this . $pageDom . find ( '.vp-popup-title' ) . text ( this . state . config . name ) ;
481
+ this . $pageDom . find ( '.vp-popup-title' ) . text ( this . name ) ;
484
482
// set body
485
483
this . $pageDom . find ( '.vp-popup-content' ) . html ( this . templateForBody ( ) ) ;
486
484
return this . $pageDom ;
@@ -848,13 +846,16 @@ define([
848
846
$ ( this . wrapSelector ( '.vp-inner-popup-box' ) ) . show ( ) ;
849
847
850
848
// 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 ( ) ;
852
852
}
853
853
854
854
/**
855
855
* Close inner popup box
856
856
*/
857
857
closeInnerPopup ( ) {
858
+ this . handleInnerCancel ( ) ;
858
859
$ ( this . wrapSelector ( '.vp-inner-popup-box' ) ) . hide ( ) ;
859
860
}
860
861
You can’t perform that action at this time.
0 commit comments