2018-03-26 11:25:17 +08:00
|
|
|
import NoteShort from './note_short.js';
|
|
|
|
|
2018-08-23 18:55:45 +08:00
|
|
|
/**
|
|
|
|
* Represents full note, specifically including note's content.
|
|
|
|
*/
|
2018-03-26 11:25:17 +08:00
|
|
|
class NoteFull extends NoteShort {
|
|
|
|
constructor(treeCache, row) {
|
|
|
|
super(treeCache, row);
|
|
|
|
|
2018-08-23 18:55:45 +08:00
|
|
|
/** @param {string} */
|
2018-03-26 11:25:17 +08:00
|
|
|
this.content = row.content;
|
|
|
|
|
2018-04-11 12:10:11 +08:00
|
|
|
if (this.content !== "" && this.isJson()) {
|
|
|
|
try {
|
2018-08-23 18:55:45 +08:00
|
|
|
/** @param {object} */
|
2018-04-11 12:10:11 +08:00
|
|
|
this.jsonContent = JSON.parse(this.content);
|
|
|
|
}
|
|
|
|
catch(e) {}
|
2018-03-26 11:25:17 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default NoteFull;
|