diff --git a/public/competenze.html b/public/competenze.html index 9d2e1f3..1bf6f7c 100644 --- a/public/competenze.html +++ b/public/competenze.html @@ -206,7 +206,17 @@ v3Icons(); var root = document.querySelector('main.wrap'); if (root && window.MutationObserver) { - var mo = new MutationObserver(function () { v3Icons(); }); + // Anti-loop: createIcons() muta il DOM (->svg) → osservare "ogni mutazione" + // e ri-chiamarlo puo' auto-ritriggerarsi (freeze). Debounce + disconnect. + var applying = false, timer = null; + var mo = new MutationObserver(function () { + if (applying) return; + clearTimeout(timer); + timer = setTimeout(function () { + applying = true; mo.disconnect(); v3Icons(); + mo.observe(root, { childList: true, subtree: true }); applying = false; + }, 120); + }); mo.observe(root, { childList: true, subtree: true }); } }); diff --git a/public/raci.html b/public/raci.html index fcaf4d3..12c6f3c 100644 --- a/public/raci.html +++ b/public/raci.html @@ -155,7 +155,17 @@ v3Icons(); var root = document.querySelector('main.wrap'); if (root && window.MutationObserver) { - var mo = new MutationObserver(function () { v3Icons(); }); + // Anti-loop: createIcons() muta il DOM (->svg) → osservare "ogni mutazione" + // e ri-chiamarlo puo' auto-ritriggerarsi (freeze). Debounce + disconnect. + var applying = false, timer = null; + var mo = new MutationObserver(function () { + if (applying) return; + clearTimeout(timer); + timer = setTimeout(function () { + applying = true; mo.disconnect(); v3Icons(); + mo.observe(root, { childList: true, subtree: true }); applying = false; + }, 120); + }); mo.observe(root, { childList: true, subtree: true }); } });