Remove ES6 syntax which breaks prod

Fixes issues introduced in #1797.

@int-y1 please refrain from using ES6 in the future if it's unnecessary,
especially in .js files.
This commit is contained in:
Quantum 2021-10-09 03:53:14 -04:00
parent f9e19d0687
commit fc25c65afc
4 changed files with 5 additions and 5 deletions

View File

@ -40,7 +40,7 @@ $(function () {
dataType: 'script',
cache: true,
success: function () {
MathJax.typesetPromise([$content[0]]).then(() => {
MathJax.typesetPromise([$content[0]]).then(function () {
$content.find('.tex-image').hide();
$content.find('.tex-text').show();
});
@ -49,7 +49,7 @@ $(function () {
}
});
} else {
MathJax.typesetPromise([$content[0]]).then(() => {
MathJax.typesetPromise([$content[0]]).then(function () {
$content.find('.tex-image').hide();
$content.find('.tex-text').show();
});

View File

@ -1,7 +1,7 @@
jQuery(function ($) {
$(document).on('martor:preview', function (e, $content) {
function update_math() {
MathJax.typesetPromise([$content[0]]).then(() => {
MathJax.typesetPromise([$content[0]]).then(function () {
$content.find('.tex-image').hide();
$content.find('.tex-text').show();
});

View File

@ -28,7 +28,7 @@
function update_math($comment) {
if ('MathJax' in window) {
var $body = $comment.find('.comment-body');
MathJax.typesetPromise([$body[0]]).then(() => {
MathJax.typesetPromise([$body[0]]).then(function () {
$body.find('.tex-image').hide();
$body.find('.tex-text').show();
});

View File

@ -1,7 +1,7 @@
<script type="text/javascript" src="{{ static('mathjax_config.js') }}"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.0/es5/tex-chtml.min.js"></script>
<script type="text/javascript">
MathJax.typesetPromise().then(() => {
MathJax.typesetPromise().then(function () {
$('.tex-image').hide();
$('.tex-text').show();
});