Close interactive dropdown on page scroll
authorAlexander Ebert <ebert@woltlab.com>
Wed, 24 Aug 2016 11:15:35 +0000 (13:15 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 24 Aug 2016 11:15:41 +0000 (13:15 +0200)
wcfsetup/install/files/js/WCF.js

index 9abf0f5f23a308351357b8d727f6e28ef6cbbfd8..6d83b88fd2b5142d23cba46c9f7fc3dd4f8dd4b5 100755 (executable)
@@ -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();
+                       }
+               }
        }
 };