Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/htmx.js
Original file line number Diff line number Diff line change
Expand Up @@ -3752,15 +3752,22 @@ return (function () {
//====================================================================
// Initialization
//====================================================================
var isReady = false
/**
* We want to initialize the page elements after DOMContentLoaded
* fires, but there isn't always a good way to tell whether
* it has already fired when we get here or not.
*/
function ready(functionToCall) {
if (isReady) {
functionToCall()
return
}

// call the function exactly once no matter how many times this is called
var callReadyFunction = function() {
if (!functionToCall) return;
isReady = true
functionToCall();
functionToCall = null;
};
Expand Down