Sha256: 8fbee2714df1b4e94d3927bb63c8e8af2c4f9ad1ba404cc16e350f1654786ad9

Contents?: true

Size: 460 Bytes

Versions: 9

Compression:

Stored size: 460 Bytes

Contents

(() => {
  const application = Stimulus.Application.start()

  application.register("image-form", class extends Stimulus.Controller {
    static get targets() {
      return ["image", "field", "button"]
    }

    remove(e) {
      // Prevent link
      e.preventDefault()
      e.stopPropagation()

      // Remove image and reset field
      this.imageTarget.remove()
      this.buttonTarget.remove()
      this.fieldTarget.value = null
    }
    
  })
})()

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
spina-1.2.0 app/assets/javascripts/spina/admin/controllers/image_form_controller.js
spina-1.1.4 app/assets/javascripts/spina/admin/controllers/image_form_controller.js
spina-1.1.3 app/assets/javascripts/spina/admin/controllers/image_form_controller.js
spina-1.1.2 app/assets/javascripts/spina/admin/controllers/image_form_controller.js
spina-1.1.1 app/assets/javascripts/spina/admin/controllers/image_form_controller.js
spina-1.1.0 app/assets/javascripts/spina/admin/controllers/image_form_controller.js
spina-1.0.3 app/assets/javascripts/spina/admin/controllers/image_form_controller.js
spina-1.0.2 app/assets/javascripts/spina/admin/controllers/image_form_controller.js
spina-1.0.1 app/assets/javascripts/spina/admin/controllers/image_form_controller.js