From ccb8185a42b4e03873c5a253f9e393349422b0c7 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Fri, 2 Oct 2020 20:41:51 +0200 Subject: [PATCH] Update CharCounter.plugin.js --- Plugins/CharCounter/CharCounter.plugin.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Plugins/CharCounter/CharCounter.plugin.js b/Plugins/CharCounter/CharCounter.plugin.js index 9584ed57d9..64297181c8 100644 --- a/Plugins/CharCounter/CharCounter.plugin.js +++ b/Plugins/CharCounter/CharCounter.plugin.js @@ -5,8 +5,13 @@ module.exports = (_ => { "info": { "name": "CharCounter", "author": "DevilBro", - "version": "1.4.9", + "version": "1.5.0", "description": "Adds a charcounter in the chat." + }, + "changeLog": { + "fixed": { + "Message Input": "Works again for the message textarea" + } } }; return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class { @@ -145,7 +150,11 @@ module.exports = (_ => { injectCounter (parent, children, type, refClass, parsing) { if (!children) return; - parent.props.className = BDFDB.DOMUtils.formatClassName(parent.props.className, BDFDB.disCN._charcountercounteradded); + if (parent.props.className) parent.props.className = BDFDB.DOMUtils.formatClassName(parent.props.className, BDFDB.disCN._charcountercounteradded); + else parent.props.children = BDFDB.ReactUtils.createElement("div", { + className: BDFDB.disCN._charcountercounteradded, + children: parent.props.children + }); children.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.CharCounter, { className: BDFDB.DOMUtils.formatClassName(BDFDB.disCN._charcountercounter, type && BDFDB.disCN[`_charcounter${typeMap[type] || type}counter`]), refClass: refClass,