Add missing javascript dependencies to package.json. Move javascripts files to app/javascript. Add first javascript test. Change test mode

This commit is contained in:
rebuilt 2021-10-15 23:47:12 +02:00
parent 414eb83f6d
commit 7ba020d04d
13 changed files with 83 additions and 54 deletions

View file

@ -0,0 +1,14 @@
export function initializeListenersForNavDropdowns(){
document.addEventListener("turbolinks:load", function() {
const schoolDropdown = document.querySelector('#select-school');
if (schoolDropdown) {
document.querySelector('#select-school').addEventListener('change', (event) => {
window.location = event.target.value;
});
document.querySelector('#select-district').addEventListener('change', (event) => {
window.location = event.target.value;
});
}
});
}