From df70b8e8ee8ec6b0c59375ea3cdd4a6d9989ea2c Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 28 Jul 2020 18:35:22 +0200 Subject: [PATCH] Place the code and inline-code button next to each other Closes #3241 --- .../files/js/3rdParty/redactor2/plugins/WoltLabButton.js | 7 +++++++ 1 file changed, 7 insertions(+) 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) { -- 2.20.1