From: Alexander Ebert Date: Tue, 28 Jul 2020 16:35:22 +0000 (+0200) Subject: Place the code and inline-code button next to each other X-Git-Tag: 5.3.0_Alpha_1~116 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=df70b8e8ee8ec6b0c59375ea3cdd4a6d9989ea2c;p=GitHub%2FWoltLab%2FWCF.git Place the code and inline-code button next to each other Closes #3241 --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabButton.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabButton.js index 3ab169d94b..15cba9f2f6 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabButton.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabButton.js @@ -83,6 +83,13 @@ $.Redactor.prototype.WoltLabButton = function() { } } + // If both the "Code" and "Inline Code" button exist, then place them next to each other. + var inlineCodeButtonIndex = this.opts.buttons.indexOf('tt'); + if (this.opts.buttons.indexOf('code') !== -1 && inlineCodeButtonIndex !== -1) { + this.opts.buttons.splice(inlineCodeButtonIndex, 1); + this.opts.buttons.splice(this.opts.buttons.indexOf('code') + 1, 0, 'tt'); + } + // enforce button order as provided with `opts.buttons` var listItem, toolbarButtons = {}, toolbarOrder = []; while (toolbar.childElementCount) {