Skip to content

Commit 4d177c1

Browse files
committed
Update blog
1 parent 5942af4 commit 4d177c1

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

  • themes/butterfly/layout/includes/page

themes/butterfly/layout/includes/page/talk.pug

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,20 @@ script.
1212
document.onscrollend = () => {
1313
talk.reflashTalkWaterFall();
1414
};
15+
16+
let resizeTimer;
17+
function onResize() {
18+
clearTimeout(resizeTimer);
19+
resizeTimer = setTimeout(() => {
20+
talk.reflashTalkWaterFall();
21+
}, 150);
22+
}
23+
window.addEventListener('resize', onResize);
24+
1525
function handlePjaxSend() {
1626
document.onscrollend = originalScrollEnd;
1727
document.removeEventListener('pjax:send', handlePjaxSend);
28+
window.removeEventListener('resize', onResize);
1829
}
1930

2031
document.addEventListener('pjax:send', handlePjaxSend);

0 commit comments

Comments
 (0)