Skip to content

Commit

Permalink
chore: Use anonymous function
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Dec 6, 2024
1 parent 0cf7789 commit 251be10
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions data_registry/templates/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,14 @@
})
})

function handleCountryChange (event) {
if (event.target.value) {
window.location.href = event.target.value
} else {
window.location.href = ''
}
}
document.addEventListener('DOMContentLoaded', () => {
document.getElementById('country-select').addEventListener('change', handleCountryChange)
const select = document.getElementById('country-select')
select.addEventListener('change', () => {
const url = select.value;
if (url) {
window.location.href = url

Check warning

Code scanning / CodeQL

DOM text reinterpreted as HTML Medium

DOM text
is reinterpreted as HTML without escaping meta-characters.
}
})
})
// {# "8. Make the button stationary." https://www.nngroup.com/articles/back-to-top/ #}
const observer = new window.IntersectionObserver(entries => {
Expand Down

0 comments on commit 251be10

Please sign in to comment.