Fix eslint

This commit is contained in:
Penar Musaraj 2019-06-14 12:47:22 -04:00
parent 19b241f69a
commit 25a65eacc9
2 changed files with 6 additions and 8 deletions

View File

@ -4,12 +4,12 @@ import loadScript from "discourse/lib/load-script";
function ensureKaTeX() { function ensureKaTeX() {
return loadScript("/plugins/discourse-math/katex/katex.min.js").then(() => { return loadScript("/plugins/discourse-math/katex/katex.min.js").then(() => {
return loadScript("/plugins/discourse-math/katex/katex.min.css", { css: true }).then(() => { return loadScript("/plugins/discourse-math/katex/katex.min.css", { css: true }).then(() => {
return loadScript("/plugins/discourse-math/katex/mhchem.min.js") return loadScript("/plugins/discourse-math/katex/mhchem.min.js");
}) });
}) });
} }
function decorate(elem, isPreview) { function decorate(elem) {
const $elem = $(elem); const $elem = $(elem);
const displayMode = elem.tagName === 'DIV'; const displayMode = elem.tagName === 'DIV';
@ -33,10 +33,8 @@ function katex($elem) {
const mathElems = $elem.find(".math"); const mathElems = $elem.find(".math");
if (mathElems.length > 0) { if (mathElems.length > 0) {
const isPreview = $elem.hasClass("d-editor-preview");
ensureKaTeX().then(() => { ensureKaTeX().then(() => {
mathElems.each((idx, elem) => decorate(elem, isPreview)); mathElems.each((idx, elem) => decorate(elem));
}); });
} }
} }

View File

@ -63,7 +63,7 @@ function decorate(elem, isPreview) {
$elem.after($mathWrapper); $elem.after($mathWrapper);
} }
Em.run.later( Ember.run.later(
this, this,
() => { () => {
window.MathJax.Hub.Queue(() => { window.MathJax.Hub.Queue(() => {