From: Alexander Ebert Date: Thu, 21 Jan 2016 12:27:45 +0000 (+0100) Subject: Improved display of button dropdowns X-Git-Tag: 3.0.0_Beta_1~2030^2~148 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1212ae1fa26913fc2badf40ae1339baf18926a02;p=GitHub%2FWoltLab%2FWCF.git Improved display of button dropdowns --- 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] = $('