Skip to content

Commit

Permalink
chore: revert change to Mathjax
Browse files Browse the repository at this point in the history
  • Loading branch information
leangseu-edx committed Jan 31, 2024
1 parent 3a16811 commit 206ddd1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 38 deletions.
14 changes: 1 addition & 13 deletions cms/djangoapps/pipeline_js/js/xmodule.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ define(
'mathjax',
function() {
window.MathJax.Hub.Config({
styles: {
'.MathJax_SVG>svg': {'max-width': '100%'},
// This is to resolve for people who use center mathjax with tables
'table>tbody>tr>td>.MathJax_SVG>svg': {'max-width': 'inherit'},
},
tex2jax: {
inlineMath: [
['\\(', '\\)'],
Expand Down Expand Up @@ -65,14 +60,7 @@ define(
if (oldWidth !== document.documentElement.scrollWidth) {
t = window.setTimeout(function() {
oldWidth = document.documentElement.scrollWidth;
MathJax.Hub.Queue(
['Rerender', MathJax.Hub],
[() => $('.MathJax_SVG>svg').toArray().forEach(el => {
if ($(el).width() === 0) {
$(el).css('max-width', 'inherit');
}
})]
);
MathJax.Hub.Queue(['Rerender', MathJax.Hub]);
t = -1;
}, delay);
}
Expand Down
10 changes: 0 additions & 10 deletions cms/templates/content_libraries/xblock_iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@
<!-- Configure and load MathJax -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
styles: {
'.MathJax_SVG>svg': { 'max-width': '100%' },
// This is to resolve for people who use center mathjax with tables
'table>tbody>tr>td>.MathJax_SVG>svg': { 'max-width': 'inherit'},
},
CommonHTML: { linebreaks: { automatic: true } },
SVG: { linebreaks: { automatic: true } },
"HTML-CSS": { linebreaks: { automatic: true } },
Expand Down Expand Up @@ -115,11 +110,6 @@
oldWidth = document.documentElement.scrollWidth;
MathJax.Hub.Queue(
["Rerender", MathJax.Hub],
[() => $('.MathJax_SVG>svg').toArray().forEach(el => {
if ($(el).width() === 0) {
$(el).css('max-width', 'inherit');
}
})]
);
t = -1;
}, delay);
Expand Down
15 changes: 0 additions & 15 deletions common/templates/mathjax_include.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@
%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%', },
// This is to resolve for people who use center mathjax with tables
'table>tbody>tr>td>.MathJax_SVG>svg': { 'max-width': 'inherit'},
},
CommonHTML: { linebreaks: { automatic: true } },
SVG: { linebreaks: { automatic: true } },
"HTML-CSS": { linebreaks: { automatic: true } },
Expand All @@ -44,11 +39,6 @@
%else:
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
styles: {
'.MathJax_SVG>svg': { 'max-width': '100%', },
// This is to resolve for people who use center mathjax with tables
'table>tbody>tr>td>.MathJax_SVG>svg': { 'max-width': 'inherit'},
},
messageStyle: "none",
CommonHTML: { linebreaks: { automatic: true } },
SVG: { linebreaks: { automatic: true } },
Expand Down Expand Up @@ -116,11 +106,6 @@
oldWidth = document.documentElement.scrollWidth;
MathJax.Hub.Queue(
["Rerender", MathJax.Hub],
[() => $('.MathJax_SVG>svg').toArray().forEach(el => {
if ($(el).width() === 0) {
$(el).css('max-width', 'inherit');
}
})]
);
t = -1;
}, delay);
Expand Down

0 comments on commit 206ddd1

Please sign in to comment.