mirror of
https://github.com/hunvreus/basecoat.git
synced 2026-11-11 04:38:18 +00:00
Fix docs sidebar after history restore
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
import "../../../src/js/basecoat.js";
|
||||
import "../../../src/js/accordion.js";
|
||||
|
||||
const initPriceRange = () => {
|
||||
const input = document.getElementById("price-range");
|
||||
const output = document.getElementById("price-range-output");
|
||||
@@ -104,3 +101,5 @@ if (document.readyState === "loading") {
|
||||
} else {
|
||||
initDemos();
|
||||
}
|
||||
|
||||
document.addEventListener("htmx:afterSettle", initDemos);
|
||||
|
||||
+2
-2
@@ -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);
|
||||
}
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user