You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

23 lines
478 B

import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ["dialog"]
connect() {
this.dialogTarget.showModal()
}
close() {
this.dialogTarget.close()
}
// A click whose target is the <dialog> itself landed on the backdrop
// (the panel fills the content box), so dismiss.
backdropClose(event) {
if (event.target === this.dialogTarget) this.close()
}
remove() {
this.element.remove()
}
}