[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
![1_default_state](https://user-images.githubusercontent.com/12510409/55963836-d4a3a680-5c73-11e9-8190-f095f8142a21.png)
Search open
![2_search_open](https://user-images.githubusercontent.com/12510409/55963845-d8372d80-5c73-11e9-8d9d-5a2b84dbb388.png)
Search closed again.
![3_search_closed](https://user-images.githubusercontent.com/12510409/55963852-dbcab480-5c73-11e9-8deb-964cf22af8f7.png)