Fix docs sidebar after history restore

This commit is contained in:
Ronan Berder
2026-06-27 21:12:05 +08:00
parent 537f77507e
commit d431873be7
2 changed files with 4 additions and 5 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
(() => {
const initSidebar = (sidebarComponent) => {
if (sidebarComponent.dataset.sidebarInitialized) return;
if (sidebarComponent.dataset.sidebarInitialized && typeof sidebarComponent.toggle === 'function') return;
const initialOpen = sidebarComponent.dataset.initialOpen !== 'false';
const initialMobileOpen = sidebarComponent.dataset.initialMobileOpen === 'true';
@@ -60,6 +60,6 @@
};
if (window.basecoat) {
window.basecoat.register('sidebar', '.sidebar:not([data-sidebar-initialized])', initSidebar);
window.basecoat.register('sidebar', '.sidebar', initSidebar);
}
})();