[FIX] RACI + Competenze: stesso anti-loop MutationObserver+createIcons dell'organigramma
Prevenzione proattiva dello stesso freeze latente trovato in organigramma: le pagine raci.html e competenze.html richiamavano createIcons() su ogni mutazione DOM. Debounce+disconnect. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
9eeef784d4
commit
69f3894c18
+11
-1
@@ -206,7 +206,17 @@
|
|||||||
v3Icons();
|
v3Icons();
|
||||||
var root = document.querySelector('main.wrap');
|
var root = document.querySelector('main.wrap');
|
||||||
if (root && window.MutationObserver) {
|
if (root && window.MutationObserver) {
|
||||||
var mo = new MutationObserver(function () { v3Icons(); });
|
// Anti-loop: createIcons() muta il DOM (<i>->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 });
|
mo.observe(root, { childList: true, subtree: true });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
+11
-1
@@ -155,7 +155,17 @@
|
|||||||
v3Icons();
|
v3Icons();
|
||||||
var root = document.querySelector('main.wrap');
|
var root = document.querySelector('main.wrap');
|
||||||
if (root && window.MutationObserver) {
|
if (root && window.MutationObserver) {
|
||||||
var mo = new MutationObserver(function () { v3Icons(); });
|
// Anti-loop: createIcons() muta il DOM (<i>->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 });
|
mo.observe(root, { childList: true, subtree: true });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user