mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-08-08 19:48:42 +08:00
* chore: bump theme version to 5.5.5 and update third-party plugins
* fix: recognize 404 in page type helper * style: adjust pagination items margin * feat: use ResizeObserver to update header positions for dynamic article heights
This commit is contained in:
+8
-1
@@ -567,7 +567,14 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
}
|
||||
|
||||
updateHeaderPositions()
|
||||
btf.addEventListenerPjax(window, 'resize', btf.throttle(updateHeaderPositions, 200))
|
||||
const throttledUpdate = btf.throttle(updateHeaderPositions, 200)
|
||||
btf.addEventListenerPjax(window, 'resize', throttledUpdate)
|
||||
|
||||
if ('ResizeObserver' in window) {
|
||||
const observer = new ResizeObserver(throttledUpdate)
|
||||
observer.observe($article)
|
||||
btf.addGlobalFn('pjaxSendOnce', () => { observer.disconnect() })
|
||||
}
|
||||
|
||||
const findHeadPosition = top => {
|
||||
if (top === 0) return false
|
||||
|
||||
Reference in New Issue
Block a user