Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com> This commit refactors the entire application to replace the 'parties' concept with 'events'. All controllers, models, views, and related files have been updated to reflect this change. The parties table has been replaced with an events table, and all related functionality has been updated accordingly.
28 lines
562 B
JavaScript
Executable File
28 lines
562 B
JavaScript
Executable File
import { Controller } from "@hotwired/stimulus"
|
|
|
|
export default class extends Controller {
|
|
static targets = ["message"]
|
|
|
|
connect() {
|
|
console.log("FlashMessageController mounted", this.element);
|
|
|
|
// Auto-dismiss after 5 seconds
|
|
this.timeout = setTimeout(() => {
|
|
this.close()
|
|
}, 5000)
|
|
}
|
|
|
|
disconnect() {
|
|
if (this.timeout) {
|
|
clearTimeout(this.timeout)
|
|
}
|
|
}
|
|
|
|
close() {
|
|
this.element.classList.add('opacity-0', 'transition-opacity', 'duration-300')
|
|
setTimeout(() => {
|
|
this.element.remove()
|
|
}, 300)
|
|
}
|
|
}
|