mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
Include the kernel object in the event object passed to kernel events
This commit is contained in:
parent
8b34dfc405
commit
e9324378e8
@ -64,7 +64,7 @@ var IPython = (function (IPython) {
|
||||
|
||||
|
||||
Kernel.prototype.restart = function () {
|
||||
$([IPython.events]).trigger('status_restarting.Kernel');
|
||||
$([IPython.events]).trigger({type: 'status_restarting.Kernel', kernel: this});
|
||||
var that = this;
|
||||
if (this.running) {
|
||||
this.stop_channels();
|
||||
@ -279,7 +279,7 @@ var IPython = (function (IPython) {
|
||||
|
||||
Kernel.prototype.interrupt = function () {
|
||||
if (this.running) {
|
||||
$([IPython.events]).trigger('status_interrupting.Kernel');
|
||||
$([IPython.events]).trigger({type: 'status_interrupting.Kernel', kernel: this});
|
||||
$.post(this.kernel_url + "/interrupt");
|
||||
};
|
||||
};
|
||||
@ -367,12 +367,12 @@ var IPython = (function (IPython) {
|
||||
}
|
||||
} else if (msg_type === 'status') {
|
||||
if (content.execution_state === 'busy') {
|
||||
$([IPython.events]).trigger('status_busy.Kernel');
|
||||
$([IPython.events]).trigger({type: 'status_busy.Kernel', kernel: this});
|
||||
} else if (content.execution_state === 'idle') {
|
||||
$([IPython.events]).trigger('status_idle.Kernel');
|
||||
$([IPython.events]).trigger({type: 'status_idle.Kernel', kernel: this});
|
||||
} else if (content.execution_state === 'dead') {
|
||||
this.stop_channels();
|
||||
$([IPython.events]).trigger('status_dead.Kernel');
|
||||
$([IPython.events]).trigger({type: 'status_dead.Kernel', kernel: this});
|
||||
};
|
||||
} else if (msg_type === 'clear_output') {
|
||||
var cb = callbacks['clear_output'];
|
||||
|
Loading…
Reference in New Issue
Block a user