From 06bb2ab802a5ae961e9584326baaef46a3a9d200 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Tue, 30 Oct 2018 22:49:50 +0100 Subject: [PATCH] fix linting error --- packages/tiptap/src/Components/FloatingMenu.js | 18 ++++++++++-------- packages/tiptap/src/Components/MenuBar.js | 18 ++++++++++-------- packages/tiptap/src/Components/MenuBubble.js | 18 ++++++++++-------- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/packages/tiptap/src/Components/FloatingMenu.js b/packages/tiptap/src/Components/FloatingMenu.js index 21f58f3d..d119ea58 100644 --- a/packages/tiptap/src/Components/FloatingMenu.js +++ b/packages/tiptap/src/Components/FloatingMenu.js @@ -20,14 +20,16 @@ export default { }, }, render(createElement) { - if (this.editor) { - return createElement('div', this.$scopedSlots.default({ - focused: this.editor.view.focused, - focus: this.editor.focus, - commands: this.editor.commands, - isActive: this.editor.isActive.bind(this.editor), - markAttrs: this.editor.markAttrs.bind(this.editor), - })) + if (!this.editor) { + return null } + + return createElement('div', this.$scopedSlots.default({ + focused: this.editor.view.focused, + focus: this.editor.focus, + commands: this.editor.commands, + isActive: this.editor.isActive.bind(this.editor), + markAttrs: this.editor.markAttrs.bind(this.editor), + })) }, } diff --git a/packages/tiptap/src/Components/MenuBar.js b/packages/tiptap/src/Components/MenuBar.js index 87d74fb2..27ccc848 100644 --- a/packages/tiptap/src/Components/MenuBar.js +++ b/packages/tiptap/src/Components/MenuBar.js @@ -6,14 +6,16 @@ export default { }, }, render(createElement) { - if (this.editor) { - return createElement('div', this.$scopedSlots.default({ - focused: this.editor.view.focused, - focus: this.editor.focus, - commands: this.editor.commands, - isActive: this.editor.isActive.bind(this.editor), - markAttrs: this.editor.markAttrs.bind(this.editor), - })) + if (!this.editor) { + return null } + + return createElement('div', this.$scopedSlots.default({ + focused: this.editor.view.focused, + focus: this.editor.focus, + commands: this.editor.commands, + isActive: this.editor.isActive.bind(this.editor), + markAttrs: this.editor.markAttrs.bind(this.editor), + })) }, } diff --git a/packages/tiptap/src/Components/MenuBubble.js b/packages/tiptap/src/Components/MenuBubble.js index 3c698de0..a5323b8f 100644 --- a/packages/tiptap/src/Components/MenuBubble.js +++ b/packages/tiptap/src/Components/MenuBubble.js @@ -20,14 +20,16 @@ export default { }, }, render(createElement) { - if (this.editor) { - return createElement('div', this.$scopedSlots.default({ - focused: this.editor.view.focused, - focus: this.editor.focus, - commands: this.editor.commands, - isActive: this.editor.isActive.bind(this.editor), - markAttrs: this.editor.markAttrs.bind(this.editor), - })) + if (!this.editor) { + return null } + + return createElement('div', this.$scopedSlots.default({ + focused: this.editor.view.focused, + focus: this.editor.focus, + commands: this.editor.commands, + isActive: this.editor.isActive.bind(this.editor), + markAttrs: this.editor.markAttrs.bind(this.editor), + })) }, }