File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,9 @@ define(['jquery',
131131 options . keyboard_manager . enable ( ) ;
132132 options . keyboard_manager . command_mode ( ) ;
133133 }
134+ if ( options . focus_button ) {
135+ $ ( options . focus_button ) . focus ( ) ;
136+ }
134137 } ) ;
135138
136139 if ( options . keyboard_manager ) {
Original file line number Diff line number Diff line change @@ -2973,7 +2973,7 @@ define([
29732973 /**
29742974 * Explicitly trust the output of this notebook.
29752975 */
2976- Notebook . prototype . trust_notebook = function ( ) {
2976+ Notebook . prototype . trust_notebook = function ( from_notification ) {
29772977 var body = $ ( "<div>" ) . append ( $ ( "<p>" )
29782978 . text ( i18n . msg . _ ( "A trusted Jupyter notebook may execute hidden malicious code when you open it. " +
29792979 "Selecting trust will immediately reload this notebook in a trusted state. " +
@@ -2989,6 +2989,7 @@ define([
29892989 keyboard_manager : this . keyboard_manager ,
29902990 title : i18n . msg . _ ( "Trust this notebook?" ) ,
29912991 body : body ,
2992+ focus_button : from_notification ,
29922993
29932994 buttons : {
29942995 Cancel : { } ,
Original file line number Diff line number Diff line change @@ -402,7 +402,7 @@ define([
402402 $ ( tnw . selector ) . css ( 'cursor' , 'help' ) ;
403403 } else {
404404 tnw . set_message ( i18n . msg . _ ( "Not Trusted" ) , undefined , function ( ) {
405- that . notebook . trust_notebook ( ) ;
405+ that . notebook . trust_notebook ( "#notification_trusted" ) ;
406406 return false ;
407407 } , { 'title' :'Javascript disabled for notebook display' } ) ;
408408 $ ( tnw . selector ) . attr ( 'role' , 'button' ) ;
You can’t perform that action at this time.
0 commit comments