mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-16 11:41:17 +02:00
chore: restore scrollbar to previous version
This commit is contained in:
parent
afa47d4880
commit
4da1c3ce48
1 changed files with 28 additions and 39 deletions
|
@ -24,7 +24,6 @@ function setupScrollbar() {
|
||||||
bodyElement.setAttribute('data-scrollbar-initialized', 'true')
|
bodyElement.setAttribute('data-scrollbar-initialized', 'true')
|
||||||
}
|
}
|
||||||
|
|
||||||
const setupSecondaryScrollbars = () => {
|
|
||||||
// Add scrollbar to TOC content
|
// Add scrollbar to TOC content
|
||||||
const tocElement = document.getElementById('toc-content')
|
const tocElement = document.getElementById('toc-content')
|
||||||
if (tocElement && !tocElement.hasAttribute('data-scrollbar-initialized')) {
|
if (tocElement && !tocElement.hasAttribute('data-scrollbar-initialized')) {
|
||||||
|
@ -63,16 +62,6 @@ function setupScrollbar() {
|
||||||
pre.setAttribute('data-scrollbar-initialized', 'true')
|
pre.setAttribute('data-scrollbar-initialized', 'true')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof window.requestIdleCallback === 'function') {
|
|
||||||
window.requestIdleCallback(setupSecondaryScrollbars, { timeout: 1000 })
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
requestAnimationFrame(() => {
|
|
||||||
setupSecondaryScrollbars()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setupScrollbar()
|
setupScrollbar()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue