Show More
@@ -76,12 +76,12 b' define([' | |||||
76 | that.element.find("#current_kernel_spec").find('.kernel_name').text(data.display_name); |
|
76 | that.element.find("#current_kernel_spec").find('.kernel_name').text(data.display_name); | |
77 | }); |
|
77 | }); | |
78 |
|
78 | |||
79 |
this.events.on(' |
|
79 | this.events.on('kernel_created.Session', function(event, data) { | |
80 |
if ( |
|
80 | if (data.kernel.name !== that.current_selection) { | |
81 | // If we created a 'python' session, we only know if it's Python |
|
81 | // If we created a 'python' session, we only know if it's Python | |
82 | // 3 or 2 on the server's reply, so we fire the event again to |
|
82 | // 3 or 2 on the server's reply, so we fire the event again to | |
83 | // set things up. |
|
83 | // set things up. | |
84 |
var ks = that.kernelspecs[ |
|
84 | var ks = that.kernelspecs[data.kernel.name]; | |
85 | that.events.trigger('spec_changed.Kernel', ks); |
|
85 | that.events.trigger('spec_changed.Kernel', ks); | |
86 | } |
|
86 | } | |
87 | }); |
|
87 | }); |
@@ -97,7 +97,9 b' define([' | |||||
97 | Session.prototype.start = function (success, error) { |
|
97 | Session.prototype.start = function (success, error) { | |
98 | var that = this; |
|
98 | var that = this; | |
99 | var on_success = function (data, status, xhr) { |
|
99 | var on_success = function (data, status, xhr) { | |
100 |
if ( |
|
100 | if (that.kernel) { | |
|
101 | that.kernel.name = that.kernel_model.name; | |||
|
102 | } else { | |||
101 | var kernel_service_url = utils.url_path_join(that.base_url, "api/kernels"); |
|
103 | var kernel_service_url = utils.url_path_join(that.base_url, "api/kernels"); | |
102 | that.kernel = new kernel.Kernel(kernel_service_url, that.ws_url, that.notebook, that.kernel_model.name); |
|
104 | that.kernel = new kernel.Kernel(kernel_service_url, that.ws_url, that.notebook, that.kernel_model.name); | |
103 | } |
|
105 | } |
General Comments 0
You need to be logged in to leave comments.
Login now