diff --git a/src/canvas/model/Frame.js b/src/canvas/model/Frame.js index 06e05328c..576f83318 100644 --- a/src/canvas/model/Frame.js +++ b/src/canvas/model/Frame.js @@ -15,7 +15,8 @@ export default Model.extend({ height: null, head: [], component: '', - styles: '' + styles: '', + _undo: true }), initialize(props, opts = {}) { diff --git a/src/pages/model/Page.js b/src/pages/model/Page.js index ae9a51fa0..54f2dcbaf 100644 --- a/src/pages/model/Page.js +++ b/src/pages/model/Page.js @@ -3,7 +3,8 @@ import Frames from 'canvas/model/Frames'; export default Model.extend({ defaults: () => ({ - frames: [] + frames: [], + _undo: true }), initialize(props, opts = {}) { diff --git a/src/undo_manager/index.js b/src/undo_manager/index.js index e024d1bd1..e422b04cc 100644 --- a/src/undo_manager/index.js +++ b/src/undo_manager/index.js @@ -33,7 +33,8 @@ export default () => { let config; let beforeCache; const configDef = { - maximumStackLength: 500 + maximumStackLength: 500, + trackSelection: 1 }; const hasSkip = opts => opts.avoidStore || opts.noUndo; const getChanged = obj => Object.keys(obj.changedAttributes()); @@ -115,6 +116,10 @@ export default () => { return this; }, + postLoad() { + config.trackSelection && em && this.add(em.get('selected')); + }, + /** * Get module configurations * @return {Object} Configuration object