From 1212ae1fa26913fc2badf40ae1339baf18926a02 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 21 Jan 2016 13:27:45 +0100 Subject: [PATCH] Improved display of button dropdowns --- wcfsetup/install/files/js/WCF.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 6df5cb2e6c..e8727cd304 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -6047,7 +6047,16 @@ WCF.InlineEditor = Class.extend({ // build dropdown var $trigger = null; if (!this._dropdowns[$elementID]) { - this._triggerElements[$elementID] = $trigger = this._getTriggerElement(this._elements[$elementID]).addClass('dropdownToggle').wrap(''); + this._triggerElements[$elementID] = $trigger = this._getTriggerElement(this._elements[$elementID]).addClass('dropdownToggle'); + var parent = $trigger[0].parentNode; + if (parent && parent.nodeName === 'LI' && parent.childElementCount === 1) { + // do not add a wrapper element if the trigger is the only child + parent.classList.add('dropdown'); + } + else { + $trigger.wrap(''); + } + this._dropdowns[$elementID] = $('