Browse Source

Clear the UndoManager on `loaded` event

pull/663/head
Artur Arseniev 9 years ago
parent
commit
4280280722
  1. 1
      src/editor/index.js
  2. 7
      src/editor/model/Editor.js
  3. 2
      src/undo_manager/index.js

1
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);
});

7
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();
};

2
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

Loading…
Cancel
Save