From 2fa8e24b264bfced505d72f9ef00b9dcb6809c88 Mon Sep 17 00:00:00 2001 From: Skedog Date: Wed, 19 Feb 2020 13:44:38 -0500 Subject: [PATCH] Fix bug toggling preview Currently the component borders are turned on when you turn the preview off, regardless of what state the borders were in before. This change checks the button's active state to ensure the button was active before turning them on. --- src/commands/view/Preview.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/commands/view/Preview.js b/src/commands/view/Preview.js index a5abf0e32..5a35db21f 100644 --- a/src/commands/view/Preview.js +++ b/src/commands/view/Preview.js @@ -49,7 +49,9 @@ export default { const { sender = {} } = this; sender.set && sender.set('active', 0); const panels = this.getPanels(editor); - editor.runCommand('sw-visibility'); + if (editor.Panels.getButton("options","sw-visibility").attributes.active) { + editor.runCommand('sw-visibility'); + } editor.getModel().runDefault(); panels.style.display = ''; const canvas = editor.Canvas.getElement();