Skip to content

Commit

Permalink
fix(view): fix pjax support for mathjax
Browse files Browse the repository at this point in the history
  • Loading branch information
isHarryh committed Dec 19, 2024
1 parent 84ed7e7 commit c0e66df
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions source/js/pjax.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}());

0 comments on commit c0e66df

Please sign in to comment.