MediaWiki:BibleGet.js: Difference between revisions
Content deleted Content added
Johnrdorazio (talk | contribs) No edit summary |
Johnrdorazio (talk | contribs) No edit summary |
||
Line 1:
//avoid duplicate bibleQuote divs
let bibleQuoteCollection = [];
let domCheckInterval =
let ajaxCount = 0;
(function($,mw){
Line 96:
}
}); //END for each
console.log("ajaxStop has fired " + ++ajaxCount + " time(s)");▼
//just because ajax requests have finished doesn't mean the dom manipulation is done...▼
//let's create a check for all elements before doing any further manipulation▼
if(domCheckInterval.length === 0){
domCheckInterval[] = setInterval(onBGetDomElementsReady,100);▼
}
}
}); //END document ready
▲ $(document).ajaxStop(function(){
▲ console.log("ajaxStop has fired " + ++ajaxCount + " time(s)");
▲ //just because ajax requests have finished doesn't mean the dom manipulation is done...
▲ //let's create a check for all elements before doing any further manipulation
▲ domCheckInterval = setInterval(onBGetDomElementsReady,100);
▲ }); //END document ajaxStop
})(jQuery,mw);
Line 123 ⟶ 126:
if(checkDomElements() === true){
console.log('All expected dom elements are now accounted for!');
clearInterval(interval);
}
doFurtherDomManipulation();
}
|