Revert ToC style and script
This commit is contained in:
parent
b246e43483
commit
115f39a4ec
|
@ -40,10 +40,6 @@
|
|||
}
|
||||
|
||||
/* Sidebar Table of Contents */
|
||||
.left-sidebar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sidebar__toc {
|
||||
position: sticky;
|
||||
top: 5rem;
|
||||
|
@ -70,9 +66,3 @@
|
|||
padding-left: 1.25rem;
|
||||
list-style-type: disc;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 43.75rem) {
|
||||
.left-sidebar {
|
||||
display: flex;
|
||||
}
|
||||
}
|
|
@ -64,14 +64,11 @@ window.addEventListener('DOMContentLoaded', (event) => {
|
|||
toc.setAttribute('open', true);
|
||||
}
|
||||
|
||||
// Hide the left sidebar if the ToC is larger than screen height
|
||||
// Remove the stickiness of the sidebar ToC if it is larger than screen height
|
||||
function preventSidebarOverflow() {
|
||||
if (document.documentElement.clientHeight < tocSidebar.offsetHeight + 50) {
|
||||
// tocSidebar.style.marginTop = "0";
|
||||
// tocSidebar.style.position = "static";
|
||||
leftSidebar.style.display = "none";
|
||||
} else {
|
||||
leftSidebar.style.display = "flex";
|
||||
tocSidebar.style.marginTop = "0";
|
||||
tocSidebar.style.position = "static";
|
||||
}
|
||||
}
|
||||
preventSidebarOverflow();
|
||||
|
|
Loading…
Reference in New Issue