diff --git a/custom.js b/custom.js index 16e571c..9121bf9 100644 --- a/custom.js +++ b/custom.js @@ -1,14 +1,20 @@ window.addEventListener("load", () => { ocamlhljs(); - setTimeout(() => checker(3), 500); + setTimeout(() => checker(3), 200); + + // When clicking on a link, we recheck images + document.addEventListener("click", () => { + setTimeout(() => checker(3), 200); + }); }); +/** Check multiple times because the page takes times to load */ const checker = (count) => { if (count == 0) { return; } if (document.getElementsByTagName("img").length === 0) { - setTimeout(() => checker(count - 1), 500); + setTimeout(() => checker(count - 1), 200); } else { svgObsidianFix(); }