From f58abdcd8d19622ce19fcbbd2daf9728cce57933 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 14 Oct 2014 20:01:07 +0200 Subject: [PATCH] Fixed empty dropdown menus behaving weird --- wcfsetup/install/files/js/WCF.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 910d695dcd..0298822cc8 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -1009,7 +1009,7 @@ WCF.Dropdown = { this._notifyCallbacks($containerID, 'close'); } - else if ($containerID === $targetID) { + else if ($containerID === $targetID && $dropdownMenu[0].children.length > 0) { $dropdown.addClass('dropdownOpen'); $dropdownMenu.addClass('dropdownOpen'); @@ -7975,6 +7975,12 @@ WCF.InlineEditor = Class.extend({ */ _proxy: null, + /** + * list of trigger elements by element id + * @var object + */ + _triggerElements: { }, + /** * list of data to update upon success * @var array @@ -8078,7 +8084,7 @@ WCF.InlineEditor = Class.extend({ // build dropdown var $trigger = null; if (!this._dropdowns[$elementID]) { - $trigger = this._getTriggerElement(this._elements[$elementID]).addClass('dropdownToggle').wrap(''); + this._triggerElements[$elementID] = $trigger = this._getTriggerElement(this._elements[$elementID]).addClass('dropdownToggle').wrap(''); this._dropdowns[$elementID] = $('