[BUGFIX] searchBtn/searchBox toggle rewrite. #515
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See: #505
Since mainNavigationSearchBtn and mainNavigationSearchBox are used in both HeaderTop and HeaderMainMenu (main-navigation) they can both potentially be activated. I adjusted the js so they both keep the same class-states and doesn't go out of sync with what is expanded or not. It's also handled correctly when clicking the search-overlay.
Typoscript constant for testing:
themes.configuration.elem.status.showHeaderTopSearch = 1
themes.configuration.elem.status.showHeaderMainMenuSearch = 1
Initial state
Search open
Search closed again.