Skip to content

Commit

Permalink
fix: relink search button (move outside content load listener)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyzha0 committed Feb 22, 2022
1 parent 714b4fc commit cdc4f1a
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions layouts/partials/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,20 +239,18 @@ <h3>No results.</h3>
}
})

window.addEventListener('DOMContentLoaded', () => {
const searchButton = document.getElementById("search-icon")
searchButton.addEventListener('click', (evt) => {
openSearch()
})
searchButton.addEventListener('keydown', (evt) => {
openSearch()
})
searchContainer.addEventListener('click', (evt) => {
closeSearch()
})
document.getElementById("search-space").addEventListener('click', (evt) => {
evt.stopPropagation()
})
const searchButton = document.getElementById("search-icon")
searchButton.addEventListener('click', (evt) => {
openSearch()
})
searchButton.addEventListener('keydown', (evt) => {
openSearch()
})
searchContainer.addEventListener('click', (evt) => {
closeSearch()
})
document.getElementById("search-space").addEventListener('click', (evt) => {
evt.stopPropagation()
})
}

Expand Down

0 comments on commit cdc4f1a

Please sign in to comment.