This commit is contained in:
Jerry Kim 2025-05-21 11:14:28 +00:00 committed by GitHub
commit a3ab6d285e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -125,6 +125,13 @@ function setupScrollspy() {
scrollHandler(); scrollHandler();
} }
// Use ResizeObserver to detect changes in the size of .article-content
const articleContent = document.querySelector(".article-content");
if (articleContent) {
const resizeObserver = new ResizeObserver(debounced(resizeHandler));
resizeObserver.observe(articleContent);
}
window.addEventListener("resize", debounced(resizeHandler)); window.addEventListener("resize", debounced(resizeHandler));
} }