mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-10 21:17:07 +08:00
Merge pull request #1734 from DeepChirp/fix-pjax-failure
fix(Pjax): 增加错误处理以防止Pjax失效
This commit is contained in:
8
layout/includes/third-party/pjax.pug
vendored
8
layout/includes/third-party/pjax.pug
vendored
@@ -29,7 +29,13 @@ script.
|
|||||||
|
|
||||||
const triggerPjaxFn = (val) => {
|
const triggerPjaxFn = (val) => {
|
||||||
if (!val) return
|
if (!val) return
|
||||||
Object.values(val).forEach(fn => fn())
|
Object.values(val).forEach(fn => {
|
||||||
|
try {
|
||||||
|
fn()
|
||||||
|
} catch (err) {
|
||||||
|
console.debug('Pjax callback failed:', err)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('pjax:send', () => {
|
document.addEventListener('pjax:send', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user