Merge pull request #1334 from isHarryh/master

fix(view): fix pjax support for mathjax
pull/1335/head
Ruipeng Zhang 2024-12-21 11:21:07 -08:00 committed by GitHub
commit c8542f8136
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 5 deletions

View File

@ -32,11 +32,18 @@
// // TODO pace start loading animation
// })
// // Listen for completion of Pjax
// document.addEventListener('pjax:complete', function() {
// return;
// // TODO pace stop loading animation
// })
// Listen for completion of Pjax
document.addEventListener('pjax:complete', () => {
// MathJax reload logic
if (window.MathJax) {
try {
window.MathJax.typesetPromise && window.MathJax.typesetPromise();
} catch (e) {
console.error('MathJax reload error:', e);
}
}
// TODO pace stop loading animation
});
document.addEventListener('DOMContentLoaded', () => initPjax());
}());