You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
531 B
20 lines
531 B
import { Controller } from "@hotwired/stimulus";
|
|
|
|
// Connects to data-controller="analyze"
|
|
export default class extends Controller {
|
|
connect() {}
|
|
refresh(event) {
|
|
let location = event.target.value;
|
|
let year_checkboxes = [...document.getElementsByName("year-checkbox")];
|
|
|
|
let selected_years = year_checkboxes
|
|
.filter((item) => {
|
|
return item.checked;
|
|
})
|
|
.map((item) => {
|
|
return item.id;
|
|
});
|
|
window.location = location + "&academic_years=" + selected_years.join(",");
|
|
}
|
|
}
|