Commit iniziale di eminuxCRM: CRM Rails con pipeline, campagne email e Docker.
Include autenticazione, progetti isolati, mail marketing HTML con SMTP, test A/B e editor WYSIWYG. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { Controller } from "@hotwired/stimulus"
|
||||
|
||||
export default class extends Controller {
|
||||
static targets = ["panel"]
|
||||
static values = { open: Boolean }
|
||||
|
||||
connect() {
|
||||
if (this.openValue) this.show()
|
||||
this.boundKey = this.onKey.bind(this)
|
||||
document.addEventListener("keydown", this.boundKey)
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
document.removeEventListener("keydown", this.boundKey)
|
||||
}
|
||||
|
||||
show() {
|
||||
this.panelTarget.classList.remove("hidden")
|
||||
this.panelTarget.querySelector("input, textarea, select")?.focus()
|
||||
}
|
||||
|
||||
hide() {
|
||||
this.panelTarget.classList.add("hidden")
|
||||
}
|
||||
|
||||
onKey(event) {
|
||||
if (event.key === "Escape") this.hide()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user