LAZY LOADING

updated a bunch of packages
This commit is contained in:
aronwk-aaron
2023-11-18 00:41:35 -06:00
parent abc8af89c5
commit b9fc039a7e
6 changed files with 192 additions and 80 deletions

View File

@@ -94,6 +94,23 @@
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
function setInnerHTML(elm, html) {
elm.innerHTML = html;
Array.from(elm.querySelectorAll("script"))
.forEach( oldScriptEl => {
const newScriptEl = document.createElement("script");
Array.from(oldScriptEl.attributes).forEach( attr => {
newScriptEl.setAttribute(attr.name, attr.value)
});
const scriptText = document.createTextNode(oldScriptEl.innerHTML);
newScriptEl.appendChild(scriptText);
oldScriptEl.parentNode.replaceChild(newScriptEl, oldScriptEl);
});
}
</script>
{% endblock %}