Middleware+View+UserState: Add toast messages

This commit is contained in:
Riyyi
2024-11-21 22:48:01 +01:00
parent 6b93045514
commit 7f1e78fa08
10 changed files with 225 additions and 10 deletions
+14
View File
@@ -0,0 +1,14 @@
// Activate Bootstrap tooltips
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
const tooltipList = [...tooltipTriggerList].map(element => new bootstrap.Tooltip(element))
// -----------------------------------------
// HTMX events
function runOnceAfterSettle(func) {
// https://htmx.org/docs/#request-operations
document.addEventListener("htmx:afterSettle", function handler(event) {
func();
document.removeEventListener("htmx:afterSwap", handler);
});
}