Skip to content

Commit

Permalink
fix: work around existing css that fail to draw mathjax (#32764)
Browse files Browse the repository at this point in the history
  • Loading branch information
leangseu-edx committed Jul 17, 2023
1 parent 4b64d83 commit df6c0fc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cms/djangoapps/pipeline_js/js/xmodule.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,14 @@ define(
t = -1;
}, delay);
}
};

// this is added to compensate for custom css that accidentally hide mathjax
$('.MathJax_SVG>svg').toArray().forEach(el => {
if ($(el).width() === 0) {
$(el).css('max-width', 'inherit');
}
});
};
}
);
window.CodeMirror = CodeMirror;
Expand Down
7 changes: 7 additions & 0 deletions cms/templates/content_libraries/xblock_iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@
t = -1;
}, delay);
}

// this is added to compensate for custom css that accidentally hide mathjax
$('.MathJax_SVG>svg').toArray().forEach(el => {
if ($(el).width() === 0) {
$(el).css('max-width', 'inherit');
}
});
};
</script>
<script type="text/x-mathjax-config">
Expand Down
7 changes: 7 additions & 0 deletions common/templates/mathjax_include.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@
t = -1;
}, delay);
}

// this is added to compensate for custom css that accidentally hide mathjax
$('.MathJax_SVG>svg').toArray().forEach(el => {
if ($(el).width() === 0) {
$(el).css('max-width', 'inherit');
}
});
};
</script>

Expand Down

0 comments on commit df6c0fc

Please sign in to comment.