tabletop-companion/app/javascript/controllers/auto_update_controller.js

16 lines
290 B
JavaScript
Raw Normal View History

2024-06-11 10:37:58 +00:00
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static values = {
updateUrl: String,
}
connect() {
this.element.addEventListener("change", this.#updateValue.bind(this))
}
#updateValue() {
this.element.requestSubmit()
}
}