Search button now properly toggles the input visibility
authorAlexander Ebert <ebert@woltlab.com>
Sat, 10 Sep 2016 16:42:43 +0000 (18:42 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 10 Sep 2016 16:42:48 +0000 (18:42 +0200)
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Header/Fixed.js

index 347153e188677e87825d1491dc53a6319ce757e1..69c643320e09a17c925c9259856c849e7a6529fd 100644 (file)
@@ -58,6 +58,10 @@ define(['Core', 'EventHandler', 'Ui/Alignment', 'Ui/CloseOverlay', 'Ui/Screen',
                                event.preventDefault();
                                event.stopPropagation();
                                
+                               if (_pageHeader.classList.contains('searchBarOpen')) {
+                                       return this._closeSearchBar();
+                               }
+                               
                                var facadeHeight = pageHeaderFacade.clientHeight;
                                var scrollTop = window.pageYOffset;
                                var skipScrollHandler = false;
@@ -115,7 +119,7 @@ define(['Core', 'EventHandler', 'Ui/Alignment', 'Ui/CloseOverlay', 'Ui/Screen',
                
                _closeSearchBar: function () {
                        _pageHeader.classList.remove('searchBarOpen');
-                       console.debug("yep");
+                       
                        ['bottom', 'left', 'right', 'top'].forEach(function(propertyName) {
                                _searchInputContainer.style.removeProperty(propertyName);
                        });