From 390f13f5aed408fa7be81d52ad784b2a1fa21d0c Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 24 Aug 2016 13:15:35 +0200 Subject: [PATCH] Close interactive dropdown on page scroll --- wcfsetup/install/files/js/WCF.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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(); + } + } } }; -- 2.20.1