diff --git a/src/editor/index.js b/src/editor/index.js index e9e133b5b..fac28d08f 100644 --- a/src/editor/index.js +++ b/src/editor/index.js @@ -571,6 +571,7 @@ module.exports = config => { // Do post render stuff after the iframe is loaded otherwise it'll // be empty during tests em.on('loaded', () => { + this.UndoManager.clear(); em.get('modules').forEach(module => { module.postRender && module.postRender(editorView); }); diff --git a/src/editor/model/Editor.js b/src/editor/model/Editor.js index 62f10f0c1..6cb880b9d 100644 --- a/src/editor/model/Editor.js +++ b/src/editor/model/Editor.js @@ -88,11 +88,10 @@ module.exports = Backbone.Model.extend({ module.onLoad(); }); - // Stuff to do post load (eg. init undo manager for loaded components) + // Stuff to do post load const postLoad = () => { - this.get('modules').forEach(module => - module.postLoad && module.postLoad(this) - ); + const modules = this.get('modules'); + modules.forEach(module => module.postLoad && module.postLoad(this)); clb && clb(); }; diff --git a/src/undo_manager/index.js b/src/undo_manager/index.js index df26561b6..41908f78c 100644 --- a/src/undo_manager/index.js +++ b/src/undo_manager/index.js @@ -1,5 +1,5 @@ /** - * This module allows to manage the stack of changes applied on canvas + * This module allows to manage the stack of changes applied in canvas * * You can access the module in this way * ```js