chore: restore scrollbar to previous version

This commit is contained in:
radishzzz 2025-05-08 20:57:36 +01:00
parent afa47d4880
commit 4da1c3ce48

View file

@ -24,7 +24,6 @@ function setupScrollbar() {
bodyElement.setAttribute('data-scrollbar-initialized', 'true')
}
const setupSecondaryScrollbars = () => {
// Add scrollbar to TOC content
const tocElement = document.getElementById('toc-content')
if (tocElement && !tocElement.hasAttribute('data-scrollbar-initialized')) {
@ -65,16 +64,6 @@ function setupScrollbar() {
})
}
if (typeof window.requestIdleCallback === 'function') {
window.requestIdleCallback(setupSecondaryScrollbars, { timeout: 1000 })
}
else {
requestAnimationFrame(() => {
setupSecondaryScrollbars()
})
}
}
setupScrollbar()
document.addEventListener('astro:after-swap', setupScrollbar)
</script>