diff --git a/IPython/html/static/notebook/js/kernelselector.js b/IPython/html/static/notebook/js/kernelselector.js index 8a62d0e..1fa777a 100644 --- a/IPython/html/static/notebook/js/kernelselector.js +++ b/IPython/html/static/notebook/js/kernelselector.js @@ -2,10 +2,11 @@ // Distributed under the terms of the Modified BSD License. define([ - 'base/js/namespace', 'jquery', + 'base/js/namespace', + 'base/js/dialog', 'base/js/utils', -], function(IPython, $, utils) { +], function($, IPython, dialog, utils) { "use strict"; var KernelSelector = function(selector, notebook) { @@ -37,6 +38,7 @@ define([ }; KernelSelector.prototype._got_kernelspecs = function(data) { + var that = this; this.kernelspecs = data.kernelspecs; var change_kernel_submenu = $("#menu-change-kernel-submenu"); var new_notebook_submenu = $("#menu-new-notebook-submenu"); @@ -54,32 +56,34 @@ define([ } }); - var i, ks, ks_submenu_entry; - // Create the Kernel > Change kernel submenu - for (i = 0; i < keys.length; i++) { - ks = this.kernelspecs[keys[i]]; - ks_submenu_entry = $("