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;
|
||||
|
@ -69,10 +65,4 @@
|
|||
padding-top: 0.5em;
|
||||
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