mcServerWebsite/assets/controllers/modpack_download_controller.js
Ploush 303fc7bcb5 ajout trop de chose
rappel pour moi : a ne plus reproduire
2026-04-09 14:58:12 +02:00

21 lines
582 B
JavaScript

// assets/controllers/modpack_download_controller.js
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static values = { url: String }
submit(event) {
event.preventDefault()
const checked = [...this.element.querySelectorAll('input[type=checkbox]:checked')]
.map(el => el.value)
const url = this.urlValue + (checked.length ? '?opt=' + checked.join('+') : '')
window.location.href = url
}
changeVersion(event) {
window.location.href = '?v=' + event.target.value
}
}