Browse Source

Track component selection

pull/3411/head
Artur Arseniev 5 years ago
parent
commit
e4e95efcfb
  1. 3
      src/canvas/model/Frame.js
  2. 3
      src/pages/model/Page.js
  3. 7
      src/undo_manager/index.js

3
src/canvas/model/Frame.js

@ -15,7 +15,8 @@ export default Model.extend({
height: null,
head: [],
component: '',
styles: ''
styles: '',
_undo: true
}),
initialize(props, opts = {}) {

3
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 = {}) {

7
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

Loading…
Cancel
Save