File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
notebook/static/notebook/js Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -2854,7 +2854,7 @@ define([
2854
2854
}
2855
2855
var that = this ;
2856
2856
var current_dir = $ ( 'body' ) . attr ( 'data-notebook-path' ) . split ( '/' ) . slice ( 0 , - 1 ) . join ( "/" ) ;
2857
- current_dir = current_dir ? currend_dir + "/" : "" ;
2857
+ current_dir = current_dir ? current_dir + "/" : "" ;
2858
2858
var dialog_body = $ ( '<div/>' ) . append (
2859
2859
$ ( '<p/>' ) . addClass ( 'save-message' )
2860
2860
. text ( i18n . msg . _ ( 'Enter a notebook path relative to notebook dir' ) )
@@ -2896,7 +2896,12 @@ define([
2896
2896
} ;
2897
2897
return that . contents . save ( nb_path , model )
2898
2898
. then ( function ( data ) {
2899
- window . open ( data . path , '_blank' ) ;
2899
+ d . modal ( 'hide' ) ;
2900
+ that . notebook_name = data . name ;
2901
+ that . notebook_path = data . path ;
2902
+ that . session . rename_notebook ( data . path ) ;
2903
+ that . events . trigger ( 'notebook_renamed.Notebook' , data ) ;
2904
+
2900
2905
} , function ( error ) {
2901
2906
console . error ( i18n . msg . _ ( error . message || 'Unknown error saving notebook' ) ) ;
2902
2907
} ) ;
@@ -2924,6 +2929,12 @@ define([
2924
2929
} ,
2925
2930
} ,
2926
2931
open : function ( ) {
2932
+ d . find ( 'input[type="text"]' ) . keydown ( function ( event ) {
2933
+ if ( event . which === keyboard . keycodes . enter ) {
2934
+ d . find ( '.btn-primary' ) . first ( ) . click ( ) ;
2935
+ return false ;
2936
+ }
2937
+ } ) ;
2927
2938
d . find ( 'input[type="text"]' ) . focus ( ) . select ( ) ;
2928
2939
}
2929
2940
} ) ;
You can’t perform that action at this time.
0 commit comments