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'; import { each } from 'underscore';
const cmdVis = 'sw-visibility'; const cmdOutline = 'core:component-outline';
export default { export default {
getPanels(editor) { getPanels(editor) {
@ -35,10 +35,10 @@ export default {
editor.select(); editor.select();
if (!this.shouldRunSwVisibility) { 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(); editor.getModel().stopDefault();
const panels = this.getPanels(editor); const panels = this.getPanels(editor);
@ -75,7 +75,7 @@ export default {
const panels = this.getPanels(editor); const panels = this.getPanels(editor);
if (this.shouldRunSwVisibility) { if (this.shouldRunSwVisibility) {
editor.runCommand(cmdVis); editor.runCommand(cmdOutline);
this.shouldRunSwVisibility = false; this.shouldRunSwVisibility = false;
} }

2
src/panels/config/config.js

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

Loading…
Cancel
Save