Enhance mobile responsiveness by updating sidebar behavior and menu button accessibility

This commit is contained in:
2025-01-30 05:53:11 +11:00
parent beefdb899c
commit df4efddcab
3 changed files with 96 additions and 78 deletions

View File

@@ -79,6 +79,11 @@ function createFileIndexItem(doc, container, level = 0) {
e.preventDefault();
loadDocument(doc.path);
history.pushState(null, '', link.href);
// Hide sidebar on mobile after clicking a link
const leftSidebar = document.querySelector('.left-sidebar');
if (window.innerWidth <= 1000) {
leftSidebar.classList.remove('show');
}
};
container.appendChild(link);
}