Sha256: ab3b2a23a8a59dc34b8de396605e30f2d42c2b08f67d02240b6f982c3fb691d4

Contents?: true

Size: 361 Bytes

Versions: 5

Compression:

Stored size: 361 Bytes

Contents

import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
  connect() {
    this.element.addEventListener("submit", this)
  }

  disconnect() {
    this.element.removeEventListener("submit", this)
  }

  handleEvent() {
    for (const element of this.element.elements) {
      element.setAttribute("readonly", true)
    }
  }
}

Version data entries

5 entries across 5 versions & 1 rubygems

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