Make Lucide rendering resilient to dynamic pool page updates
Some checks failed
CodeQL / Analyze (javascript) (push) Failing after 26s
Some checks failed
CodeQL / Analyze (javascript) (push) Failing after 26s
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
**/
|
||||
|
||||
Reference in New Issue
Block a user