Make nodes starting with 'mxj-' count as having isMathJax set.
This commit is contained in:
parent
9b37d422b4
commit
bfe88a01a2
|
@ -1975,7 +1975,7 @@ MathJax.Hub = {
|
||||||
getJaxFor: function (element) {
|
getJaxFor: function (element) {
|
||||||
if (typeof(element) === 'string') {element = document.getElementById(element)}
|
if (typeof(element) === 'string') {element = document.getElementById(element)}
|
||||||
if (element && element.MathJax) {return element.MathJax.elementJax}
|
if (element && element.MathJax) {return element.MathJax.elementJax}
|
||||||
if (element && element.isMathJax) {
|
if (this.isMathJaxNode(element)) {
|
||||||
while (element && !element.jaxID) {element = element.parentNode}
|
while (element && !element.jaxID) {element = element.parentNode}
|
||||||
if (element) {return MathJax.OutputJax[element.jaxID].getJaxFromMath(element)}
|
if (element) {return MathJax.OutputJax[element.jaxID].getJaxFromMath(element)}
|
||||||
}
|
}
|
||||||
|
@ -1984,14 +1984,17 @@ MathJax.Hub = {
|
||||||
|
|
||||||
isJax: function (element) {
|
isJax: function (element) {
|
||||||
if (typeof(element) === 'string') {element = document.getElementById(element)}
|
if (typeof(element) === 'string') {element = document.getElementById(element)}
|
||||||
if (element && element.isMathJax) {return 1}
|
if (this.isMathJaxNode(element.tagName)) {return 1}
|
||||||
if (element && element.tagName != null && element.tagName.toLowerCase() === 'script') {
|
if (element && (element.tagName||"").toLowerCase() === 'script') {
|
||||||
if (element.MathJax)
|
if (element.MathJax)
|
||||||
{return (element.MathJax.state === MathJax.ElementJax.STATE.PROCESSED ? 1 : -1)}
|
{return (element.MathJax.state === MathJax.ElementJax.STATE.PROCESSED ? 1 : -1)}
|
||||||
if (element.type && this.inputJax[element.type.replace(/ *;(.|\s)*/,"")]) {return -1}
|
if (element.type && this.inputJax[element.type.replace(/ *;(.|\s)*/,"")]) {return -1}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
},
|
},
|
||||||
|
isMathJaxNode: function (element) {
|
||||||
|
return !!element && (element.isMathJax || (element.tagName||"").substr(0,4) === "MJX-");
|
||||||
|
},
|
||||||
|
|
||||||
setRenderer: function (renderer,type) {
|
setRenderer: function (renderer,type) {
|
||||||
if (!renderer) return;
|
if (!renderer) return;
|
||||||
|
@ -2644,7 +2647,7 @@ MathJax.Hub.Startup = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
HashCheck: function (target) {
|
HashCheck: function (target) {
|
||||||
if (target.isMathJax) {
|
if (this.isMathJaxNode(target)) {
|
||||||
var jax = MathJax.Hub.getJaxFor(target);
|
var jax = MathJax.Hub.getJaxFor(target);
|
||||||
if (jax && MathJax.OutputJax[jax.outputJax].hashCheck)
|
if (jax && MathJax.OutputJax[jax.outputJax].hashCheck)
|
||||||
{target = MathJax.OutputJax[jax.outputJax].hashCheck(target)}
|
{target = MathJax.OutputJax[jax.outputJax].hashCheck(target)}
|
||||||
|
|
|
@ -250,7 +250,7 @@
|
||||||
if (SETTINGS.discoverable || SETTINGS.zoom === "Hover") {
|
if (SETTINGS.discoverable || SETTINGS.zoom === "Hover") {
|
||||||
var from = event.fromElement || event.relatedTarget,
|
var from = event.fromElement || event.relatedTarget,
|
||||||
to = event.toElement || event.target;
|
to = event.toElement || event.target;
|
||||||
if (from && to && (from.isMathJax != to.isMathJax ||
|
if (from && to && (HUB.isMathJaxNode(from) !== HUB.isMathJaxNode(to) ||
|
||||||
HUB.getJaxFor(from) !== HUB.getJaxFor(to))) {
|
HUB.getJaxFor(from) !== HUB.getJaxFor(to))) {
|
||||||
var jax = this.getJaxFromMath(math);
|
var jax = this.getJaxFromMath(math);
|
||||||
if (jax.hover) {HOVER.ReHover(jax)} else {HOVER.HoverTimer(jax,math)}
|
if (jax.hover) {HOVER.ReHover(jax)} else {HOVER.HoverTimer(jax,math)}
|
||||||
|
@ -267,7 +267,7 @@
|
||||||
if (SETTINGS.discoverable || SETTINGS.zoom === "Hover") {
|
if (SETTINGS.discoverable || SETTINGS.zoom === "Hover") {
|
||||||
var from = event.fromElement || event.relatedTarget,
|
var from = event.fromElement || event.relatedTarget,
|
||||||
to = event.toElement || event.target;
|
to = event.toElement || event.target;
|
||||||
if (from && to && (from.isMathJax != to.isMathJax ||
|
if (from && to && (HUB.isMathJaxNode(from) !== HUB.isMathJaxNode(to) ||
|
||||||
HUB.getJaxFor(from) !== HUB.getJaxFor(to))) {
|
HUB.getJaxFor(from) !== HUB.getJaxFor(to))) {
|
||||||
var jax = this.getJaxFromMath(math);
|
var jax = this.getJaxFromMath(math);
|
||||||
if (jax.hover) {HOVER.UnHover(jax)} else {HOVER.ClearHoverTimer()}
|
if (jax.hover) {HOVER.UnHover(jax)} else {HOVER.ClearHoverTimer()}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user