diff --git a/src/commands/view/SwitchVisibility.js b/src/commands/view/SwitchVisibility.js index 8dba5761d..6f58639c1 100644 --- a/src/commands/view/SwitchVisibility.js +++ b/src/commands/view/SwitchVisibility.js @@ -16,11 +16,9 @@ export default { toggleVis(ed, active = 1) { if (!ed.Commands.isActive('preview')) { const cv = ed.Canvas; + const mth = active ? 'on' : 'off'; cv.getFrames().forEach(frame => this._upFrame(frame, active)); - cv.getModel()[active ? 'on' : 'off']( - 'change:frames', - this._onFramesChange - ); + cv.getModel()[mth]('change:frames', this._onFramesChange); } },