From 7f2b9bae8fc3d1bc296e42861e71aa5a4ff88681 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Fri, 30 Oct 2015 15:15:01 -0700 Subject: [PATCH] Fix TeX Preview not being typeset if MathJax wasn't loaded when the button was pressed. --- src/Miscellaneous/Fourchan.coffee | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Miscellaneous/Fourchan.coffee b/src/Miscellaneous/Fourchan.coffee index 9f7d1daa8..1748fde4d 100755 --- a/src/Miscellaneous/Fourchan.coffee +++ b/src/Miscellaneous/Fourchan.coffee @@ -37,6 +37,11 @@ Fourchan = if (!document.querySelector('script[src^="//cdn.mathjax.org/"]')) { window.loadMathJax(); window.loadMathJax = function() {}; + if (!e.target.classList.contains('postMessage')) { + document.querySelector('script[src^="//cdn.mathjax.org/"]').addEventListener('load', function() { + window.MathJax.Hub.Queue(['Typeset', window.MathJax.Hub, e.target]); + }, false); + } } } }, false);