diff --git a/src/commands/view/SwitchVisibility.js b/src/commands/view/SwitchVisibility.js index 49cbbf443..3164c62e0 100644 --- a/src/commands/view/SwitchVisibility.js +++ b/src/commands/view/SwitchVisibility.js @@ -1,9 +1,16 @@ export default { run(ed) { - ed.Canvas.getBody().className = this.ppfx + 'dashed'; + this.toggleVis(ed); }, stop(ed) { - ed.Canvas.getBody().className = ''; + this.toggleVis(ed, 0); + }, + + toggleVis(ed, active = 1) { + const method = active ? 'add' : 'remove'; + ed.Canvas.getFrames().forEach(frame => { + frame.view.getBody().classList[method](`${this.ppfx}dashed`); + }); } };