Browse Source

Update preview command

pull/4685/head
Artur Arseniev 4 years ago
parent
commit
39073f0fa7
  1. 8
      src/commands/view/Preview.js
  2. 2
      src/panels/config/config.js

8
src/commands/view/Preview.js

@ -1,6 +1,6 @@
import { each } from 'underscore';
const cmdVis = 'sw-visibility';
const cmdOutline = 'core:component-outline';
export default {
getPanels(editor) {
@ -35,10 +35,10 @@ export default {
editor.select();
if (!this.shouldRunSwVisibility) {
this.shouldRunSwVisibility = editor.Commands.isActive(cmdVis);
this.shouldRunSwVisibility = editor.Commands.isActive(cmdOutline);
}
this.shouldRunSwVisibility && editor.stopCommand(cmdVis);
this.shouldRunSwVisibility && editor.stopCommand(cmdOutline);
editor.getModel().stopDefault();
const panels = this.getPanels(editor);
@ -75,7 +75,7 @@ export default {
const panels = this.getPanels(editor);
if (this.shouldRunSwVisibility) {
editor.runCommand(cmdVis);
editor.runCommand(cmdOutline);
this.shouldRunSwVisibility = false;
}

2
src/panels/config/config.js

@ -23,7 +23,7 @@ export default {
active: true,
id: swv,
className: 'fa fa-square-o',
command: swv,
command: 'core:component-outline',
context: swv,
attributes: { title: 'View components' },
},

Loading…
Cancel
Save