mirror of
https://github.com/codex-team/editor.js
synced 2024-06-02 14:02:17 +02:00
Update clear method
This commit is contained in:
parent
30464668b9
commit
bc3e3615f5
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -753,7 +753,7 @@ module.exports = (function (content) {
|
|||
editor.ui.saveInputs();
|
||||
if (all) {
|
||||
|
||||
editor.state.blocks = null;
|
||||
editor.state.blocks = {};
|
||||
|
||||
} else if (editor.state.blocks) {
|
||||
|
||||
|
@ -774,11 +774,11 @@ module.exports = (function (content) {
|
|||
*/
|
||||
content.load = function (articleData) {
|
||||
|
||||
var currentContent = editor.state.blocks ? Object.assign({}, editor.state.blocks) : null;
|
||||
var currentContent = Object.assign({}, editor.state.blocks);
|
||||
|
||||
editor.content.clear();
|
||||
|
||||
if (!currentContent) {
|
||||
if (!Object.keys(currentContent).length) {
|
||||
|
||||
editor.state.blocks = articleData;
|
||||
|
||||
|
|
Loading…
Reference in a new issue