Skip to content

Commit

Permalink
Revert "fix: mathjax resize on sindow resize (openedx#32606)"
Browse files Browse the repository at this point in the history
This reverts commit a68fd49.
  • Loading branch information
leangseu-edx committed Jul 7, 2023
1 parent e705820 commit 9dac65a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 45 deletions.
18 changes: 0 additions & 18 deletions cms/templates/content_libraries/xblock_iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,6 @@
<!-- Configure and load MathJax -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
styles: {
'.MathJax_SVG>svg': { 'max-width': '100%' },
},
CommonHTML: { linebreaks: { automatic: true } },
SVG: { linebreaks: { automatic: true } },
"HTML-CSS": { linebreaks: { automatic: true } },
tex2jax: {
inlineMath: [
["\\(","\\)"],
Expand All @@ -98,18 +92,6 @@
]
}
});
window.addEventListener('resize', MJrenderer);
let 1 = -1;
let delay = 1000;
function MJrenderer() {
if (t >= 0) {
window.clearTimeout(t);
}
t = window.setTimeout(function() {
MathJax.Hub.Queue(["Rerenderer", MathJax.Hub]);
t = -1;
}, delay);
};
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.signal.Interest(function(message) {
Expand Down
27 changes: 0 additions & 27 deletions common/templates/mathjax_include.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,14 @@
%if mathjax_mode is not Undefined and mathjax_mode == 'wiki':
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
styles: {
'.MathJax_SVG>svg': { 'max-width': '100%', },
},
CommonHTML: { linebreaks: { automatic: true } },
SVG: { linebreaks: { automatic: true } },
"HTML-CSS": { linebreaks: { automatic: true } },
tex2jax: {inlineMath: [ ['$','$'], ["\\(","\\)"]],
displayMath: [ ['$$','$$'], ["\\[","\\]"]]}
});
</script>
%else:
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
styles: {
'.MathJax_SVG>svg': { 'max-width': '100%', },
},
messageStyle: "none",
CommonHTML: { linebreaks: { automatic: true } },
SVG: { linebreaks: { automatic: true } },
"HTML-CSS": { linebreaks: { automatic: true } },
tex2jax: {
inlineMath: [
["\\(","\\)"],
Expand Down Expand Up @@ -97,21 +85,6 @@
explorer: true
}
};
window.addEventListener('resize', MJrerender);

let t = -1;
let delay = 1000;
function MJrerender() {
if (t >= 0) {
// If we are still waiting, then the user is still resizing =>
// postpone the action further!
window.clearTimeout(t);
}
t = window.setTimeout(function() {
MathJax.Hub.Queue(["Rerender",MathJax.Hub]);
t = -1; // Reset the handle
}, delay);
};
</script>

<!-- This must appear after all mathjax-config blocks, so it is after the imports from the other templates.
Expand Down

0 comments on commit 9dac65a

Please sign in to comment.