Skip to content

Commit

Permalink
MDL-79039 mathjax: Fix variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
HuongNV13 committed Aug 25, 2023
1 parent 3421925 commit 15aaa09
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion filter/mathjaxloader/amd/build/loader.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion filter/mathjaxloader/amd/build/loader.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions filter/mathjaxloader/amd/src/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ export const typeset = () => {
if (!configured) {
setLocale();
const elements = document.getElementsByClassName('filter_mathjaxloader_equation');
for (let i = 0; i < elements.length; i++) {
if (typeof window.MathJax !== "undefined") {
window.MathJax.Hub.Queue(["Typeset", window.MathJax.Hub, elements[i]]);
}
if (elements) {
elements.forEach((element) => {
if (typeof window.MathJax !== "undefined") {
window.MathJax.Hub.Queue(["Typeset", window.MathJax.Hub, element]);
}
});
}
}
};
Expand All @@ -106,18 +108,18 @@ export const contentUpdated = (event) => {
if (typeof window.MathJax === "undefined") {
return;
}
const processdelay = window.MathJax.Hub.processSectionDelay;
const processDelay = window.MathJax.Hub.processSectionDelay;
// Set the process section delay to 0 when updating the formula.
window.MathJax.Hub.processSectionDelay = 0;
// When content is updated never position to hash, it may cause unexpected document scrolling.
window.MathJax.Hub.Config({positionToHash: false});
setLocale();
// The list of HTMLElements in an Array.
event.detail.nodes.forEach((node) => {
const mathjaxElements = node.querySelectorAll('.filter_mathjaxloader_equation');
const mathjaxElements = node.getElementsByClassName('filter_mathjaxloader_equation');
mathjaxElements.forEach((node) => {
window.MathJax.Hub.Queue(["Typeset", window.MathJax.Hub, node]);
});
});
window.MathJax.Hub.processSectionDelay = processdelay;
window.MathJax.Hub.processSectionDelay = processDelay;
};

0 comments on commit 15aaa09

Please sign in to comment.