fix(econ): render latex labels on mathjax ready
This commit is contained in:
parent
8707530a50
commit
01d7681b6b
1 changed files with 29 additions and 13 deletions
|
|
@ -664,7 +664,23 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", function () {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
MathJax.typeset()
|
// wait for mathjax
|
||||||
|
if (typeof MathJax !== "undefined") {
|
||||||
|
MathJax.typeset();
|
||||||
|
initSliderEvents();
|
||||||
|
} else {
|
||||||
|
window.MathJax = {
|
||||||
|
startup: {
|
||||||
|
pageReady: function () {
|
||||||
|
return MathJax.startup.defaultPageReady().then(function () {
|
||||||
|
initSliderEvents();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function initSliderEvents() {
|
||||||
document.querySelectorAll(".sliders").forEach((slidersDiv) => {
|
document.querySelectorAll(".sliders").forEach((slidersDiv) => {
|
||||||
slidersDiv.addEventListener("input", function (event) {
|
slidersDiv.addEventListener("input", function (event) {
|
||||||
const graphDiv = slidersDiv.previousElementSibling;
|
const graphDiv = slidersDiv.previousElementSibling;
|
||||||
|
|
@ -676,5 +692,5 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue