Include autenticazione, progetti isolati, mail marketing HTML con SMTP, test A/B e editor WYSIWYG. Co-authored-by: Cursor <cursoragent@cursor.com>
22 lines
468 B
JavaScript
22 lines
468 B
JavaScript
import { Controller } from "@hotwired/stimulus"
|
|
|
|
export default class extends Controller {
|
|
static targets = ["checkbox", "panel", "grid"]
|
|
|
|
connect() {
|
|
this.sync()
|
|
}
|
|
|
|
toggle() {
|
|
this.sync()
|
|
}
|
|
|
|
sync() {
|
|
if (!this.hasCheckboxTarget) return
|
|
|
|
const on = this.checkboxTarget.checked
|
|
this.panelTargets.forEach((el) => el.classList.toggle("hidden", !on))
|
|
if (this.hasGridTarget) this.gridTarget.classList.toggle("lg:grid-cols-2", on)
|
|
}
|
|
}
|