mcServerWebsite/app/assets/controllers/modpack_download_controller.js
2026-04-09 15:23:15 +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
}
}