Enhance mobile library loading: implement virtualization for improved performance and memory management on mobile devices

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-23 22:05:52 +02:00
parent f6755aad42
commit 52656c715e
2 changed files with 158 additions and 43 deletions
+10 -1
View File
@@ -1871,6 +1871,8 @@
function adaptNavbarByWidth() {
if (!navList) return;
const isMobileViewport = window.matchMedia('(max-width: 991.98px)').matches;
function isNavOverflowing(bufferPx) {
const buffer = typeof bufferPx === 'number' ? bufferPx : 0;
const collapseOverflow = navCollapse ? (navCollapse.scrollWidth > (navCollapse.clientWidth - buffer)) : false;
@@ -1881,7 +1883,14 @@
applyCompactMode();
if (window.innerWidth < 992) {
// Desktop/tablet-large: keep complete navigation visible.
if (!isMobileViewport) {
restoreAllNavItems();
return;
}
// Mobile menu is collapsed: avoid hiding links preemptively.
if (navCollapse && !navCollapse.classList.contains('show')) {
restoreAllNavItems();
return;
}