diff --git a/app/javascript/controllers/dialog_controller.js b/app/javascript/controllers/dialog_controller.js index 512aac9db..0dc924c39 100644 --- a/app/javascript/controllers/dialog_controller.js +++ b/app/javascript/controllers/dialog_controller.js @@ -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() { diff --git a/app/views/bubbles/_color.html.erb b/app/views/bubbles/_color.html.erb index c3787045e..0ff307628 100644 --- a/app/views/bubbles/_color.html.erb +++ b/app/views/bubbles/_color.html.erb @@ -1,5 +1,5 @@ -
-