From 398389a3fc28db7569f80bfd08b39bf52e4b68ba Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 22 Feb 2017 15:04:49 +0100 Subject: [PATCH] Properly resetting editor toolbar --- .../files/js/3rdParty/redactor2/plugins/WoltLabCode.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCode.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCode.js index 1c0bcd7ddf..e2e5b06383 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCode.js @@ -13,6 +13,16 @@ $.Redactor.prototype.WoltLabCode = function() { WCF.System.Event.fireEvent('com.woltlab.wcf.redactor2', 'codeStart_' + this.$element[0].id); }).bind(this); + + var mpSet = this.code.set; + this.code.set = (function(html, options) { + mpSet.call(this, html, options); + + if (this.utils.isEmpty()) { + // reset all buttons + this.observe.toolbar(); + } + }).bind(this); } }; }; -- 2.20.1