Controllers+Views+Routes: Add ScriptAfterLoad functionality
This commit is contained in:
+9
-3
@@ -1,11 +1,17 @@
|
||||
window.web = {};
|
||||
|
||||
// -----------------------------------------
|
||||
|
||||
// Activate Bootstrap tooltips
|
||||
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
|
||||
const tooltipList = [...tooltipTriggerList].map(element => new bootstrap.Tooltip(element))
|
||||
web.tooltips = function() {
|
||||
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
|
||||
const tooltipList = [...tooltipTriggerList].map(element => new bootstrap.Tooltip(element))
|
||||
}
|
||||
|
||||
// -----------------------------------------
|
||||
// HTMX events
|
||||
|
||||
function runOnceAfterSettle(func) {
|
||||
web.afterLoad = function(func) {
|
||||
// https://htmx.org/docs/#request-operations
|
||||
document.addEventListener("htmx:afterSettle", function handler(event) {
|
||||
func();
|
||||
|
||||
Reference in New Issue
Block a user