diff --git a/IPython/frontend/html/notebook/static/js/codecell.js b/IPython/frontend/html/notebook/static/js/codecell.js
index 8accb9218..ab157a265 100644
--- a/IPython/frontend/html/notebook/static/js/codecell.js
+++ b/IPython/frontend/html/notebook/static/js/codecell.js
@@ -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) {
diff --git a/IPython/frontend/html/notebook/static/js/notebook.js b/IPython/frontend/html/notebook/static/js/notebook.js
index 2a27ebcc7..c9b45548d 100644
--- a/IPython/frontend/html/notebook/static/js/notebook.js
+++ b/IPython/frontend/html/notebook/static/js/notebook.js
@@ -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);