Refactoring exit button.
This commit is contained in:
parent
976558e3f0
commit
758da4f84f
@ -42,12 +42,14 @@ function addListenersSearch() {
|
||||
}
|
||||
const exitSearch = document.querySelector('a.exit-search')
|
||||
if (exitSearch !== null) {
|
||||
exitSearch.addEventListener('click', () => {
|
||||
const searchOverlay = document.querySelector('div.search-overlay');
|
||||
if (searchOverlay !== null) {
|
||||
searchOverlay.classList.toggle('active');
|
||||
}
|
||||
});
|
||||
exitSearch.addEventListener('click', onExitSearch)
|
||||
}
|
||||
}
|
||||
|
||||
function onExitSearch() {
|
||||
const searchOverlay = document.querySelector('div.search-overlay');
|
||||
if (searchOverlay !== null) {
|
||||
searchOverlay.classList.toggle('active');
|
||||
}
|
||||
}
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user