Include autenticazione, progetti isolati, mail marketing HTML con SMTP, test A/B e editor WYSIWYG. Co-authored-by: Cursor <cursoragent@cursor.com>
24 lines
480 B
JavaScript
24 lines
480 B
JavaScript
import { Controller } from "@hotwired/stimulus"
|
|
|
|
export default class extends Controller {
|
|
static targets = ["menu"]
|
|
|
|
toggle(event) {
|
|
event.stopPropagation()
|
|
this.menuTarget.classList.toggle("hidden")
|
|
}
|
|
|
|
connect() {
|
|
this.boundClose = this.close.bind(this)
|
|
document.addEventListener("click", this.boundClose)
|
|
}
|
|
|
|
disconnect() {
|
|
document.removeEventListener("click", this.boundClose)
|
|
}
|
|
|
|
close() {
|
|
this.menuTarget.classList.add("hidden")
|
|
}
|
|
}
|