From f076329636819d45a4e2533c873f589124f8d154 Mon Sep 17 00:00:00 2001 From: David Wheatley Date: Mon, 17 May 2021 14:43:35 +0100 Subject: [PATCH] Fix tooltip deprecation warning --- .../js/src/forum/components/MarkdownButton.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/extensions/markdown/js/src/forum/components/MarkdownButton.js b/extensions/markdown/js/src/forum/components/MarkdownButton.js index b5bf49b56..457380167 100644 --- a/extensions/markdown/js/src/forum/components/MarkdownButton.js +++ b/extensions/markdown/js/src/forum/components/MarkdownButton.js @@ -1,20 +1,29 @@ import Component from 'flarum/common/Component'; import icon from 'flarum/common/helpers/icon'; +import Tooltip from 'flarum/common/components/Tooltip'; export default class MarkdownButton extends Component { oncreate(vnode) { super.oncreate(vnode); - - this.$().tooltip(); } view() { - return ( - ); + + if (this.attrs.title) { + return {button}; + } + + return button; } keydown(event) {