Browse Source

Add and use getModel in canvas module

pull/3411/head
Artur Arseniev 6 years ago
parent
commit
dd58554e52
  1. 4
      src/canvas/index.js
  2. 9
      src/commands/view/SwitchVisibility.js

4
src/canvas/index.js

@ -84,6 +84,10 @@ export default () => {
return this;
},
getModel() {
return canvas;
},
/**
* Get the configuration object
* @return {Object}

9
src/commands/view/SwitchVisibility.js

@ -15,9 +15,12 @@ export default {
toggleVis(ed, active = 1) {
if (!ed.Commands.isActive('preview')) {
const cvModel = ed.Canvas.getCanvasView().model;
ed.Canvas.getFrames().forEach(frame => this._upFrame(frame, active));
cvModel[active ? 'on' : 'off']('change:frames', this._onFramesChange);
const cv = ed.Canvas;
cv.getFrames().forEach(frame => this._upFrame(frame, active));
cv.getModel()[active ? 'on' : 'off'](
'change:frames',
this._onFramesChange
);
}
},

Loading…
Cancel
Save