Move event handler to maction element rather than duplication it in two places (for HTML-CSS output).

This commit is contained in:
Davide P. Cervone 2015-10-17 23:36:13 -04:00
parent 415be7eaf7
commit ecbfb344c3

View File

@ -92,25 +92,26 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
HTMLaction: {
toggle: function (span,frame,selection) {
this.selection = selection;
frame.onclick = span.childNodes[1].onclick = MathJax.Callback(["HTMLclick",this]);
frame.style.cursor = span.childNodes[1].style.cursor="pointer";
span.onclick = MathJax.Callback(["HTMLclick",this]);
frame.style.cursor = span.childNodes[1].style.cursor = "pointer";
},
statusline: function (span,frame,selection) {
frame.onmouseover = span.childNodes[1].onmouseover = MathJax.Callback(["HTMLsetStatus",this]);
frame.onmouseout = span.childNodes[1].onmouseout = MathJax.Callback(["HTMLclearStatus",this]);
frame.onmouseover.autoReset = frame.onmouseout.autoReset = true;
span.onmouseover = MathJax.Callback(["HTMLsetStatus",this]);
span.onmouseout = MathJax.Callback(["HTMLclearStatus",this]);
span.onmouseover.autoReset = span.onmouseout.autoReset = true;
frame.style.cursor = span.childNodes[1].style.cursor = "default";
},
tooltip: function(span,frame,selection) {
if (this.data[1] && this.data[1].isToken) {
frame.title = frame.alt = span.childNodes[1].title =
span.childNodes[1].alt = this.data[1].data.join("");
span.title = span.alt = this.data[1].data.join("");
} else {
frame.onmouseover = span.childNodes[1].onmouseover = MathJax.Callback(["HTMLtooltipOver",this]);
frame.onmouseout = span.childNodes[1].onmouseout = MathJax.Callback(["HTMLtooltipOut",this]);
frame.onmouseover.autoReset = frame.onmouseout.autoReset = true;
span.onmouseover = MathJax.Callback(["HTMLtooltipOver",this]);
span.onmouseout = MathJax.Callback(["HTMLtooltipOut",this]);
span.onmouseover.autoReset = span.onmouseout.autoReset = true;
}
frame.style.cursor = span.childNodes[1].style.cursor = "default";
}
},