##// END OF EJS Templates
Add submenu under kernel for changing kernel
Thomas Kluyver -
Show More
@@ -29,6 +29,8 b' define(['
29 KernelSelector.prototype.got_kernelspecs = function(data, status, xhr) {
29 KernelSelector.prototype.got_kernelspecs = function(data, status, xhr) {
30 this.kernelspecs = {};
30 this.kernelspecs = {};
31 var menu = this.element.find("#kernel_selector");
31 var menu = this.element.find("#kernel_selector");
32 var change_kernel_submenu = $("#menu-change-kernel-submenu");
33 console.log(change_kernel_submenu);
32 for (var i = 0; i < data.length; i++) {
34 for (var i = 0; i < data.length; i++) {
33 var ks = data[i];
35 var ks = data[i];
34 this.kernelspecs[ks.name] = ks;
36 this.kernelspecs[ks.name] = ks;
@@ -37,6 +39,12 b' define(['
37 .click($.proxy(this.change_kernel, this, ks.name))
39 .click($.proxy(this.change_kernel, this, ks.name))
38 .text(ks.display_name));
40 .text(ks.display_name));
39 menu.append(ksentry);
41 menu.append(ksentry);
42
43 var ks_submenu_entry = $("<li>").attr("id", "kernel-submenu-"+ks.name).append($('<a>')
44 .attr('href', '#')
45 .click($.proxy(this.change_kernel, this, ks.name))
46 .text(ks.display_name));
47 change_kernel_submenu.append(ks_submenu_entry);
40 }
48 }
41 };
49 };
42
50
@@ -226,6 +226,11 b' class="notebook_app"'
226 <li id="restart_kernel"
226 <li id="restart_kernel"
227 title="Restart the Kernel">
227 title="Restart the Kernel">
228 <a href="#">Restart</a></li>
228 <a href="#">Restart</a></li>
229 <li class="divider"></li>
230 <li id="menu-change-kernel" class="dropdown-submenu">
231 <a href="#">Change kernel</a>
232 <ul class="dropdown-menu" id="menu-change-kernel-submenu"></ul>
233 </li>
229 </ul>
234 </ul>
230 </li>
235 </li>
231 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Help</a>
236 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Help</a>
General Comments 0
You need to be logged in to leave comments. Login now