Skip to content

Commit

Permalink
Merge pull request ipython#1451 from minrk/headlevel
Browse files Browse the repository at this point in the history
Include heading level in JSON. Closes ipython#1439.
  • Loading branch information
fperez committed Feb 28, 2012
2 parents fca15c2 + 6b433f6 commit 4f20a02
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions IPython/frontend/html/notebook/static/js/textcell.js
Expand Up @@ -296,6 +296,21 @@ var IPython = (function (IPython) {
HeadingCell.prototype = new TextCell();


HeadingCell.prototype.fromJSON = function (data) {
if (data.level != undefined){
this.level = data.level;
}
IPython.TextCell.prototype.fromJSON.apply(this, arguments);
};


HeadingCell.prototype.toJSON = function () {
var data = IPython.TextCell.prototype.toJSON.apply(this);
data.level = this.get_level();
return data;
};


HeadingCell.prototype.set_level = function (level) {
this.level = level;
if (this.rendered) {
Expand Down

0 comments on commit 4f20a02

Please sign in to comment.