mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
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:
parent
414eb83f6d
commit
7ba020d04d
13 changed files with 83 additions and 54 deletions
14
app/javascript/dashboard.js
Normal file
14
app/javascript/dashboard.js
Normal 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;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue