Skip to content

Commit c8542f8

Browse files
authored
Merge pull request ppoffice#1334 from isHarryh/master
fix(view): fix pjax support for mathjax
2 parents 84ed7e7 + c0e66df commit c8542f8

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

source/js/pjax.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,18 @@
3232
// // TODO pace start loading animation
3333
// })
3434

35-
// // Listen for completion of Pjax
36-
// document.addEventListener('pjax:complete', function() {
37-
// return;
38-
// // TODO pace stop loading animation
39-
// })
35+
// Listen for completion of Pjax
36+
document.addEventListener('pjax:complete', () => {
37+
// MathJax reload logic
38+
if (window.MathJax) {
39+
try {
40+
window.MathJax.typesetPromise && window.MathJax.typesetPromise();
41+
} catch (e) {
42+
console.error('MathJax reload error:', e);
43+
}
44+
}
45+
// TODO pace stop loading animation
46+
});
4047

4148
document.addEventListener('DOMContentLoaded', () => initPjax());
4249
}());

0 commit comments

Comments
 (0)