From 2f213fe6914be2d4f0ef486b2cf113e63b7cc9a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20V=C3=A9ril?= Date: Thu, 30 Apr 2020 20:31:30 +0200 Subject: [PATCH] Check if MathJax.typesetPromise exist before define it in the polyfill --- static/js/MathJaxPolyfill.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/static/js/MathJaxPolyfill.js b/static/js/MathJaxPolyfill.js index 6c09d8ce..66f83b30 100644 --- a/static/js/MathJaxPolyfill.js +++ b/static/js/MathJaxPolyfill.js @@ -1,8 +1,10 @@ function MathJaxPolyfillInit(){ - var typesetPromise = function() { - return new Promise(function (resolve, reject) { - MathJax.Hub.Queue(["Typeset",MathJax.Hub],[resolve]); - }) + if (!MathJax.typesetPromise) { + var typesetPromise = function() { + return new Promise(function (resolve, reject) { + MathJax.Hub.Queue(["Typeset",MathJax.Hub],[resolve]); + }) + } + MathJax.typesetPromise=typesetPromise } - MathJax.typesetPromise=typesetPromise } \ No newline at end of file