diff --git a/IPython/html/static/notebook/js/cell.js b/IPython/html/static/notebook/js/cell.js index 13ce3cbd5..502df103f 100644 --- a/IPython/html/static/notebook/js/cell.js +++ b/IPython/html/static/notebook/js/cell.js @@ -52,7 +52,7 @@ var IPython = (function (IPython) { // same order. Easiest is to create and set to null in parent class. this.element = null; - this.cell_type = null; + this.cell_type = this.cell_type || null; this.code_mirror = null; @@ -201,6 +201,7 @@ var IPython = (function (IPython) { Cell.prototype.toJSON = function () { var data = {}; data.metadata = this.metadata; + data.cell_type = this.cell_type; return data; }; diff --git a/IPython/html/static/notebook/js/codecell.js b/IPython/html/static/notebook/js/codecell.js index 9b32496fe..440989455 100644 --- a/IPython/html/static/notebook/js/codecell.js +++ b/IPython/html/static/notebook/js/codecell.js @@ -444,7 +444,6 @@ var IPython = (function (IPython) { CodeCell.prototype.toJSON = function () { var data = IPython.Cell.prototype.toJSON.apply(this); data.input = this.get_text(); - data.cell_type = 'code'; // is finite protect against undefined and '*' value if (isFinite(this.input_prompt_number)) { data.prompt_number = this.input_prompt_number; diff --git a/IPython/html/static/notebook/js/textcell.js b/IPython/html/static/notebook/js/textcell.js index c19e201dc..8d7f4486d 100644 --- a/IPython/html/static/notebook/js/textcell.js +++ b/IPython/html/static/notebook/js/textcell.js @@ -276,7 +276,6 @@ var IPython = (function (IPython) { */ TextCell.prototype.toJSON = function () { var data = IPython.Cell.prototype.toJSON.apply(this); - data.cell_type = this.cell_type; data.source = this.get_text(); if (data.source == this.placeholder) { data.source = ""; @@ -357,7 +356,7 @@ var IPython = (function (IPython) { var that = this; this.element.focusout( function() { that.auto_highlight(); } - ); + ); }; RawCell.options_default = {