Sha256: f362423d8b8139ca113f18bfee119b777b2499e56125312faad337e397d1e86b

Contents?: true

Size: 388 Bytes

Versions: 3

Compression:

Stored size: 388 Bytes

Contents

import { Controller } from "stimulus"

export default class extends Controller {

  connect() {
    this.element[this.identifier] = this
  }

  close() {
    this.element.remove()
    this.modalTurboFrame.src = null
  }
  
  escClose(event) {
    if (event.key === 'Escape') this.close()
  }
  
  get modalTurboFrame() {
    return document.querySelector("turbo-frame[id='modal']")
  }

}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spina-2.2.0 app/assets/javascripts/spina/controllers/modal_controller.js
spina-2.1.1 app/assets/javascripts/spina/controllers/modal_controller.js
spina-2.1.0 app/assets/javascripts/spina/controllers/modal_controller.js