X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fassets%2Ficons.js;h=e88e8ca770c10a7c1f0ed400acdaf481079bbba5;hb=refs%2Fheads%2Fmaster;hp=b79c9e89fbcf6bb72f17b87b9db6f3b1a784949a;hpb=281c4c4798ff3366a0efb1f65a80b451804bedab;p=poolifier.git
diff --git a/docs/assets/icons.js b/docs/assets/icons.js
index b79c9e89..e88e8ca7 100644
--- a/docs/assets/icons.js
+++ b/docs/assets/icons.js
@@ -1,15 +1,18 @@
-(function(svg) {
- svg.innerHTML = ``;
- svg.style.display = 'none';
- if (location.protocol === 'file:') {
- if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', updateUseElements);
- else updateUseElements()
- function updateUseElements() {
- document.querySelectorAll('use').forEach(el => {
- if (el.getAttribute('href').includes('#icon-')) {
- el.setAttribute('href', el.getAttribute('href').replace(/.*#/, '#'));
- }
- });
- }
+(function() {
+ addIcons();
+ function addIcons() {
+ if (document.readyState === "loading") return document.addEventListener("DOMContentLoaded", addIcons);
+ const svg = document.body.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg"));
+ svg.innerHTML = `""`;
+ svg.style.display = "none";
+ if (location.protocol === "file:") updateUseElements();
}
-})(document.body.appendChild(document.createElementNS('http://www.w3.org/2000/svg', 'svg')))
\ No newline at end of file
+
+ function updateUseElements() {
+ document.querySelectorAll("use").forEach(el => {
+ if (el.getAttribute("href").includes("#icon-")) {
+ el.setAttribute("href", el.getAttribute("href").replace(/.*#/, "#"));
+ }
+ });
+ }
+})()
\ No newline at end of file