Don't try to check for jax if specified element is null (prevents a crash)

This commit is contained in:
Davide P. Cervone 2011-05-18 14:52:49 -04:00
parent d54cfb2519
commit 861d254bec
2 changed files with 4 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -29,7 +29,7 @@ if (document.getElementById && document.childNodes && document.createElement) {
if (!window.MathJax) {window.MathJax= {}}
if (!MathJax.Hub) { // skip if already loaded
MathJax.version = "1.1.5";
MathJax.version = "1.1.6";
/**********************************************************/
@ -1264,14 +1264,14 @@ MathJax.Hub = {
getJaxFor: function (element) {
if (typeof(element) === 'string') {element = document.getElementById(element)}
if (element.MathJax) {return element.MathJax.elementJax}
if (element && element.MathJax) {return element.MathJax.elementJax}
// FIXME: also check for results of outputJax
return null;
},
isJax: function (element) {
if (typeof(element) === 'string') {element = document.getElementById(element)}
if (element.tagName != null && element.tagName.toLowerCase() === 'script') {
if (element && element.tagName != null && element.tagName.toLowerCase() === 'script') {
if (element.MathJax)
{return (element.MathJax.state === MathJax.ElementJax.STATE.PROCESSED ? 1 : -1)}
if (element.type && this.config.inputJax[element.type.replace(/ *;(.|\s)*/,"")]) {return -1}