summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorCheng-Han, Wu2016-02-24 10:57:33 +0800
committerCheng-Han, Wu2016-02-24 10:57:33 +0800
commitfae3c02bb2c340a652d726bfdda171788f286580 (patch)
tree343e093ae4749be083503c21af374c7c38abce1a /public
parentdaf4c9dcae1606bb1554f6d3f42fbf5c2cc599fc (diff)
Fixed mathjax queue might parse whole page if pass an empty or single item array
Diffstat (limited to 'public')
-rw-r--r--public/js/extra.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/public/js/extra.js b/public/js/extra.js
index 200a4652..a82a53c2 100644
--- a/public/js/extra.js
+++ b/public/js/extra.js
@@ -208,8 +208,13 @@ function finishView(view) {
//mathjax
var mathjaxdivs = view.find('.mathjax.raw').removeClass("raw").toArray();
try {
- MathJax.Hub.Queue(["Typeset", MathJax.Hub, mathjaxdivs]);
- MathJax.Hub.Queue(viewAjaxCallback);
+ if (mathjaxdivs.length > 1) {
+ MathJax.Hub.Queue(["Typeset", MathJax.Hub, mathjaxdivs]);
+ MathJax.Hub.Queue(viewAjaxCallback);
+ } else if (mathjaxdivs.length > 0) {
+ MathJax.Hub.Queue(["Typeset", MathJax.Hub, mathjaxdivs[0]]);
+ MathJax.Hub.Queue(viewAjaxCallback);
+ }
} catch (err) {}
//sequence diagram
var sequences = view.find(".sequence-diagram.raw").removeClass("raw");