Update clear method

This commit is contained in:
George Berezhnoy 2017-08-30 16:04:17 +03:00
parent 30464668b9
commit bc3e3615f5
3 changed files with 5 additions and 5 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -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;