8338190: TOC vertical offsets not updated when document size changes

Reviewed-by: jjg
This commit is contained in:
Hannes Wallnöfer 2024-08-19 17:47:25 +00:00
parent 6460b30048
commit c7690c34c2

View File

@ -461,7 +461,7 @@ document.addEventListener("DOMContentLoaded", function(e) {
})
}
// Resize handler
function handleResize(e) {
new ResizeObserver((entries) => {
if (expanded) {
if (windowWidth !== window.innerWidth) {
collapse();
@ -475,7 +475,5 @@ document.addEventListener("DOMContentLoaded", function(e) {
handleScroll();
}
setTopMargin();
}
window.addEventListener("orientationchange", handleResize);
window.addEventListener("resize", handleResize);
}).observe(document.body);
});