Fix color dialog behavior

This commit is contained in:
Jason Zimdars
2024-10-02 16:19:01 -05:00
parent 63c4493f7e
commit 4d26a8c765
2 changed files with 20 additions and 3 deletions
@@ -2,9 +2,26 @@ import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = [ "dialog" ]
static values = {
modal: { type: Boolean, default: false }
}
open() {
this.dialogTarget.showModal()
const modal = this.modalValue
if (modal) {
this.dialogTarget.showModal()
} else {
this.dialogTarget.show()
}
}
toggle() {
if (this.dialogTarget.open) {
this.close()
} else {
this.open()
}
}
close() {