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

Version Path
solidus_admin-0.3.2 app/javascript/solidus_admin/controllers/confirm_controller.js
solidus_admin-0.3.1 app/javascript/solidus_admin/controllers/confirm_controller.js
solidus_admin-0.3.0 app/javascript/solidus_admin/controllers/confirm_controller.js
solidus_admin-0.2.0 app/javascript/solidus_admin/controllers/confirm_controller.js
solidus_admin-0.1.0 app/javascript/solidus_admin/controllers/confirm_controller.js