mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-24 12:05:22 +08:00
Making Notebook.set_dirty an event so CodeCell can set it.
This allows code outside notebook.js to set the dirty flag, but doesn't require that code depend on notebook.js.
This commit is contained in:
parent
9826a17ae2
commit
4c31453ea7
@ -170,7 +170,7 @@ var IPython = (function (IPython) {
|
||||
CodeCell.prototype._handle_execute_reply = function (content) {
|
||||
this.set_input_prompt(content.execution_count);
|
||||
this.element.removeClass("running");
|
||||
// this.dirty = true;
|
||||
$([IPython.events]).trigger('set_dirty.Notebook', {'value': true});
|
||||
}
|
||||
|
||||
CodeCell.prototype._handle_set_next_input = function (text) {
|
||||
|
@ -68,6 +68,10 @@ var IPython = (function (IPython) {
|
||||
that.dirty = true;
|
||||
});
|
||||
|
||||
$([IPython.events]).on('set_dirty.Notebook', function (event, data) {
|
||||
that.dirty = data.value;
|
||||
});
|
||||
|
||||
$([IPython.events]).on('select.Cell', function (event, data) {
|
||||
var index = that.find_cell_index(data.cell);
|
||||
that.select(index);
|
||||
|
Loading…
Reference in New Issue
Block a user