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.
Brian Granger 14 years ago
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…
Cancel
Save