This commit was merged in pull request #285.
This commit is contained in:
@@ -38,4 +38,14 @@
|
|||||||
window.addEventListener('resize', refresh);
|
window.addEventListener('resize', refresh);
|
||||||
if (scroller !== window && scroller) scroller.addEventListener('input', refresh);
|
if (scroller !== window && scroller) scroller.addEventListener('input', refresh);
|
||||||
refresh();
|
refresh();
|
||||||
|
/* #282: the first evaluation can run before the layout settles (media
|
||||||
|
queries, web fonts, async highlighting) and under-measure the content,
|
||||||
|
leaving the nav hidden on long pages. Re-check once a real layout exists
|
||||||
|
and after load; the ResizeObserver also catches late content growth. */
|
||||||
|
requestAnimationFrame(function () { requestAnimationFrame(refresh); });
|
||||||
|
window.addEventListener('load', refresh);
|
||||||
|
window.setTimeout(refresh, 300);
|
||||||
|
if (window.ResizeObserver && scroller === window && document.body) {
|
||||||
|
new ResizeObserver(refresh).observe(document.body);
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
|
|||||||
Reference in New Issue
Block a user