Fix [Math Processing Error] objects to work with new menu code in 2.6.0.
This commit is contained in:
parent
6000aa1d78
commit
78fce5d3dc
|
@ -2352,7 +2352,8 @@ MathJax.Hub = {
|
||||||
if (err.line||err.lineNumber) message += "\n"+LOCALIZE("ErrorLine","line: %1",err.line||err.lineNumber);
|
if (err.line||err.lineNumber) message += "\n"+LOCALIZE("ErrorLine","line: %1",err.line||err.lineNumber);
|
||||||
message += "\n\n"+LOCALIZE("ErrorTips","Debugging tips: use %1, inspect %2 in the browser console","'unpacked/MathJax.js'","'MathJax.Hub.lastError'");
|
message += "\n\n"+LOCALIZE("ErrorTips","Debugging tips: use %1, inspect %2 in the browser console","'unpacked/MathJax.js'","'MathJax.Hub.lastError'");
|
||||||
script.MathJax.error = MathJax.OutputJax.Error.Jax(message,script);
|
script.MathJax.error = MathJax.OutputJax.Error.Jax(message,script);
|
||||||
|
if (script.MathJax.elementJax)
|
||||||
|
script.MathJax.error.inputID = script.MathJax.elementJax.inputID;
|
||||||
//
|
//
|
||||||
// Create the [Math Processing Error] span
|
// Create the [Math Processing Error] span
|
||||||
//
|
//
|
||||||
|
@ -2361,28 +2362,23 @@ MathJax.Hub = {
|
||||||
var error = MathJax.HTML.Element("span", {
|
var error = MathJax.HTML.Element("span", {
|
||||||
className:"MathJax_Error", jaxID:"Error", isMathJax:true,
|
className:"MathJax_Error", jaxID:"Error", isMathJax:true,
|
||||||
id: script.MathJax.error.inputID+"-Frame"
|
id: script.MathJax.error.inputID+"-Frame"
|
||||||
},errorText);
|
},[["span",null,errorText]]);
|
||||||
//
|
//
|
||||||
// Attach the menu events
|
// Attach the menu events
|
||||||
//
|
//
|
||||||
if (MathJax.Extension.MathEvents) {
|
MathJax.Ajax.Require("[MathJax]/extensions/MathEvents.js",function () {
|
||||||
var EVENT = MathJax.Extension.MathEvents.Event;
|
var EVENT = MathJax.Extension.MathEvents.Event
|
||||||
|
HUB = MathJax.Hub;
|
||||||
error.oncontextmenu = EVENT.Menu;
|
error.oncontextmenu = EVENT.Menu;
|
||||||
error.onmousedown = EVENT.Mousedown;
|
error.onmousedown = EVENT.Mousedown;
|
||||||
error.onkeydown = EVENT.Keydown;
|
error.keydown = EVENT.Keydown;
|
||||||
error.tabIndex = this.getTabOrder(this.getJaxFor(script));
|
error.tabIndex = HUB.getTabOrder(HUB.getJaxFor(script));
|
||||||
} else {
|
});
|
||||||
MathJax.Ajax.Require("[MathJax]/extensions/MathEvents.js",function () {
|
|
||||||
var EVENT = MathJax.Extension.MathEvents.Event;
|
|
||||||
error.oncontextmenu = EVENT.Menu;
|
|
||||||
error.onmousedown = EVENT.Mousedown;
|
|
||||||
error.keydown = EVENT.Keydown;
|
|
||||||
error.tabIndex = this.getTabOrder(this.getJaxFor(script));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//
|
//
|
||||||
// Insert the error into the page and remove any preview
|
// Insert the error into the page and remove any preview
|
||||||
//
|
//
|
||||||
|
var node = document.getElementById(error.id);
|
||||||
|
if (node) node.parentNode.removeChild(node);
|
||||||
script.parentNode.insertBefore(error,script);
|
script.parentNode.insertBefore(error,script);
|
||||||
if (script.MathJax.preview) {script.MathJax.preview.innerHTML = ""}
|
if (script.MathJax.preview) {script.MathJax.preview.innerHTML = ""}
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue
Block a user