diff --git a/notebook/static/notebook/js/actions.js b/notebook/static/notebook/js/actions.js index d387c17ee..b0990a622 100644 --- a/notebook/static/notebook/js/actions.js +++ b/notebook/static/notebook/js/actions.js @@ -71,10 +71,9 @@ define(function(require){ help_index: 'be', handler: function (env) { var notebook = env.notebook; - notebook.events.one('kernel_ready.Kernel', function () { + notebook.restart_kernel().then(function() { notebook.execute_all_cells(); }); - notebook.restart_kernel(); } }, 'restart': { diff --git a/notebook/static/notebook/js/notebook.js b/notebook/static/notebook/js/notebook.js index 2a02c5e17..22d2a5eb1 100644 --- a/notebook/static/notebook/js/notebook.js +++ b/notebook/static/notebook/js/notebook.js @@ -323,7 +323,7 @@ define(function (require) { Notebook.prototype.show_command_palette = function() { var x = new commandpalette.CommandPalette(this); - } + }; /** * Trigger a warning dialog about missing functionality from newer minor versions @@ -667,11 +667,11 @@ define(function (require) { } var current_selection = this.get_selected_cells(); for (var i=0; i").text( 'Do you want to restart the current kernel? You will lose all variables defined in it.' @@ -1806,17 +1819,18 @@ define(function (require) { "class" : "btn-danger", "click" : function(){ that.clear_all_output(); - that.kernel.restart(); + restart_and_resolve(); }, }, "Restart" : { "class" : "btn-warning", "click" : function() { - that.kernel.restart(); + restart_and_resolve(); } }, } }); + return promise; }; /**