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
@@ -1,3 +1,17 @@
/* -------------------------------------- */
/* Toast */
.toast-container {
position: fixed;
bottom: 30px;
left: 50%;
transform: translateX(-50%);
z-index: 999;
}
/* -------------------------------------- */
/* Table */
tr.htmx-swapping td {
opacity: 0;
transition: opacity 0.5s ease-out;
+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);
});
}