Sha256: c367554fc159237cd796ceb3b1b06a1592e35b2b2a67e4a0b1c63e5124d67d4c
Contents?: true
Size: 472 Bytes
Versions: 5
Compression:
Stored size: 472 Bytes
Contents
import { Controller } from "@hotwired/stimulus" export default class extends Controller { static values = {"text": String} connect() { this.element.addEventListener("click", this) this.element.addEventListener("submit", this) } disconnect() { this.element.removeEventListener("click", this) this.element.removeEventListener("submit", this) } handleEvent(event) { if (!confirm(this.textValue)) { event.preventDefault() } } }
Version data entries
5 entries across 5 versions & 1 rubygems