Browse Source

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.
pull/2589/head
Skedog 7 years ago
committed by GitHub
parent
commit
2fa8e24b26
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/commands/view/Preview.js

4
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();

Loading…
Cancel
Save