mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
include heading level in JSON
adds level-including to/fromJSON methods to HeadingCell
This commit is contained in:
parent
7ad2568d53
commit
8de583a6cd
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user