Browse Source

Use stopCommand in Preview command. Closes #2174

refactor-traits
Artur Arseniev 7 years ago
parent
commit
bc29327976
  1. 1
      docs/modules/Components.md
  2. 2
      src/commands/view/Preview.js

1
docs/modules/Components.md

@ -201,6 +201,7 @@ Now that we know how components work, we can start exploring the process of crea
Let's say we want to make the editor understand and handle better `<input>` elements
First of all, place your components inside a plugin

2
src/commands/view/Preview.js

@ -28,7 +28,7 @@ export default {
const helper = document.createElement('span');
helper.className = `${pfx}off-prv fa fa-eye-slash`;
editorEl.appendChild(helper);
helper.onclick = () => editor.stopCommand('preview');
helper.onclick = () => this.stopCommand();
this.helper = helper;
}

Loading…
Cancel
Save