this._notifyCallbacks($containerID, 'close');
}
- else if ($containerID === $targetID) {
+ else if ($containerID === $targetID && $dropdownMenu[0].children.length > 0) {
$dropdown.addClass('dropdownOpen');
$dropdownMenu.addClass('dropdownOpen');
*/
_proxy: null,
+ /**
+ * list of trigger elements by element id
+ * @var object<object>
+ */
+ _triggerElements: { },
+
/**
* list of data to update upon success
* @var array<object>
// build dropdown
var $trigger = null;
if (!this._dropdowns[$elementID]) {
- $trigger = this._getTriggerElement(this._elements[$elementID]).addClass('dropdownToggle').wrap('<span class="dropdown" />');
+ this._triggerElements[$elementID] = $trigger = this._getTriggerElement(this._elements[$elementID]).addClass('dropdownToggle').wrap('<span class="dropdown" />');
this._dropdowns[$elementID] = $('<ul class="dropdownMenu" />').insertAfter($trigger);
}
this._dropdowns[$elementID].empty();
if (!$count) {
$quickOption.trigger('click');
- if ($trigger !== null) {
- WCF.Dropdown.close($trigger.parents('.dropdown').wcfIdentify());
+ if (this._triggerElements[$elementID]) {
+ WCF.Dropdown.close(this._triggerElements[$elementID].parents('.dropdown').wcfIdentify());
}
return false;