Allow SVG jax to laod without crashing in IE8 and below (but still get math processing errors). At least this doesn't need the timeout delay waiting for loadComplete() to be called.

This commit is contained in:
Davide P. Cervone 2012-01-23 11:01:11 -05:00
parent 033e6ee6d1
commit 6456a50e52
2 changed files with 18 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -1891,5 +1891,21 @@
if (HUB.config.menuSettings.zoom !== "None")
{AJAX.Require("[MathJax]/extensions/MathZoom.js")}
});
if (!document.createElementNS) {
//
// Try to handle SVG in IE8 and below, but fail
// (but don't crash on loading the file, so no delay for loadComplete)
//
if (!document.namespaces.svg) {document.namespaces.add("svg",SVGNS)}
SVG.Augment({
Element: function (type,def) {
var obj = (typeof(type) === "string" ? document.createElement("svg:"+type) : type);
obj.isMathJax = true;
if (def) {for (var id in def) {if (def.hasOwnProperty(id)) {obj.setAttribute(id,def[id].toString())}}}
return obj;
}
});
}
})(MathJax.Ajax, MathJax.Hub, MathJax.HTML, MathJax.OutputJax.SVG);