From: Alexander Ebert Date: Wed, 24 Aug 2016 11:15:35 +0000 (+0200) Subject: Close interactive dropdown on page scroll X-Git-Tag: 3.0.0_Beta_1~527 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=390f13f5aed408fa7be81d52ad784b2a1fa21d0c;p=GitHub%2FWoltLab%2FWCF.git Close interactive dropdown on page scroll --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 9abf0f5f23..6d83b88fd2 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -1013,7 +1013,7 @@ WCF.Dropdown.Interactive.Handler = { window.addEventListener('scroll', (function (event) { if (!document.documentElement.classList.contains('pageOverlayActive')) { - this.closeAll.bind(this) + this.closeAll(); } }).bind(this)); } @@ -1060,9 +1060,11 @@ WCF.Dropdown.Interactive.Handler = { * Closes all interactive dropdowns. */ closeAll: function() { - $.each(this._dropdownMenus, function(identifier, instance) { - instance.close(); - }); + for (var instance in this._dropdownMenus) { + if (this._dropdownMenus.hasOwnProperty(instance)) { + this._dropdownMenus[instance].close(); + } + } } };