Permit to modify contestants categories
This commit is contained in:
@@ -54,13 +54,13 @@ javascript:
|
||||
option value=category.id
|
||||
= category.name
|
||||
javascript:
|
||||
const select = document.getElementById('categories');
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const selectedCategory = urlParams.get('category');
|
||||
Array.from(select.children).forEach((option) => {
|
||||
categorySelectEl = document.getElementById('categories');
|
||||
urlParams = new URLSearchParams(window.location.search);
|
||||
selectedCategory = urlParams.get('category');
|
||||
Array.from(categorySelectEl.children).forEach((option) => {
|
||||
if (option.value == selectedCategory) option.selected = true;
|
||||
});
|
||||
select.addEventListener('change', (e) => {
|
||||
categorySelectEl.addEventListener('change', (e) => {
|
||||
window.location.href = `#{contest_path(@contest)}?category=${e.target.value}`
|
||||
})
|
||||
.d-flex.flex-column style="overflow-y: auto"
|
||||
|
Reference in New Issue
Block a user