mirror of
https://github.com/litruv/Docs-Viewer.git
synced 2026-07-24 10:46:09 +10:00
Enhance mobile responsiveness by updating sidebar behavior and menu button accessibility
This commit is contained in:
5
index.js
5
index.js
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user