From bc2932797653512cf912aca57f86e9b8c94ffc70 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 31 Jul 2019 00:39:38 +0200 Subject: [PATCH] Use stopCommand in Preview command. Closes #2174 --- docs/modules/Components.md | 1 + src/commands/view/Preview.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/modules/Components.md b/docs/modules/Components.md index 8d7779d40..2129ce02e 100644 --- a/docs/modules/Components.md +++ b/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 `` elements +First of all, place your components inside a plugin diff --git a/src/commands/view/Preview.js b/src/commands/view/Preview.js index 7cbfe3fda..a5abf0e32 100644 --- a/src/commands/view/Preview.js +++ b/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; }