From: Alexander Ebert Date: Sat, 10 Sep 2016 15:57:23 +0000 (+0200) Subject: Properly closing search bar on dropdown open X-Git-Tag: 3.0.0_Beta_1~232 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=18688807122dacf5e2731dd1f572f55b423733cb;p=GitHub%2FWoltLab%2FWCF.git Properly closing search bar on dropdown open --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 2460648d9d..b0725e4824 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -1200,10 +1200,7 @@ WCF.Dropdown.Interactive.Instance = Class.extend({ this._triggerElement.addClass('open'); this._container.addClass('open'); - var pageHeader = elById('pageHeader'); - if (pageHeader && pageHeader.classList.contains('searchBarOpen')) { - pageHeader.classList.remove('searchBarOpen'); - } + WCF.System.Event.fireEvent('com.woltlab.wcf.Search', 'close'); this.render(); }, diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Header/Fixed.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Header/Fixed.js index 85b9ff34a1..347153e188 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Header/Fixed.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Header/Fixed.js @@ -31,6 +31,8 @@ define(['Core', 'EventHandler', 'Ui/Alignment', 'Ui/CloseOverlay', 'Ui/Screen', unmatch: function () { _isMobile = false; }, setup: function () { _isMobile = true; } }); + + EventHandler.add('com.woltlab.wcf.Search', 'close', this._closeSearchBar.bind(this)); }, /** @@ -113,7 +115,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); });