Make Lucide rendering resilient to dynamic pool page updates
Some checks failed
CodeQL / Analyze (javascript) (push) Failing after 26s

This commit is contained in:
Codex Bot
2026-03-24 13:12:08 +01:00
parent a7501107d2
commit 2afc57c8f5
2 changed files with 27 additions and 3 deletions

View File

@@ -17,7 +17,7 @@
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<link href="themes/default.css?" rel="stylesheet">
<link href="themes/custom.css" rel="stylesheet">
<link href="themes/custom.css?v=20260324b" rel="stylesheet">
</head>
<body>
@@ -92,8 +92,8 @@
<!-- Javascript -->
<script src="config.js?"></script>
<script src="lang/languages.js"></script>
<script src="js/common.js"></script>
<script src="js/custom.js"></script>
<script src="js/common.js?v=20260324b"></script>
<script src="js/custom.js?v=20260324b"></script>
<script>
// Store last pool statistics
let lastStats;

View File

@@ -93,6 +93,30 @@ function renderLucideIcons(root) {
}
}
let lucideRenderScheduled = false;
function scheduleLucideRender() {
if (lucideRenderScheduled) return;
lucideRenderScheduled = true;
requestAnimationFrame(function() {
lucideRenderScheduled = false;
renderLucideIcons(document.body);
});
}
$(function() {
const pageRoot = document.getElementById('page');
if (!pageRoot || typeof MutationObserver === 'undefined') return;
const observer = new MutationObserver(function() {
scheduleLucideRender();
});
observer.observe(pageRoot, {
childList: true,
subtree: true
});
});
/**
* Cookies handler
**/