From 81b97874548025ba659e56e37a5196ba532682d5 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 5 Sep 2019 19:48:41 +0200 Subject: [PATCH] Update SwitchVisibility for multiple frames --- src/commands/view/SwitchVisibility.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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`); + }); } };