Files
sure/app/javascript/controllers/modal_controller.js
Rob Zolkos 10399df3d0 Fix height of modal during account creation steps (#418)
* Don't reopen an already open modal

* Avoid changing height of modal during wizard steps
2024-02-09 19:21:19 -06:00

17 lines
371 B
JavaScript

import { Controller } from "@hotwired/stimulus"
// Connects to data-controller="modal"
export default class extends Controller {
connect() {
if (this.element.open) return
else this.element.showModal()
}
// Hide the dialog when the user clicks outside of it
click_outside(e) {
if (e.target === this.element) {
this.element.close();
}
}
}