commit 78fce5d3dc57950ef545d2686177424cf10dbabe
parent 6000aa1d7810c3f0b9d38bc0fa1327c328f61b51
Author: Davide P. Cervone <dpvc@union.edu>
Date: Sat, 6 Feb 2016 13:42:16 -0500
Fix [Math Processing Error] objects to work with new menu code in 2.6.0.
Diffstat:
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js
@@ -2352,7 +2352,8 @@ MathJax.Hub = {
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'");
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
//
@@ -2361,28 +2362,23 @@ MathJax.Hub = {
var error = MathJax.HTML.Element("span", {
className:"MathJax_Error", jaxID:"Error", isMathJax:true,
id: script.MathJax.error.inputID+"-Frame"
- },errorText);
+ },[["span",null,errorText]]);
//
// Attach the menu events
//
- if (MathJax.Extension.MathEvents) {
- var EVENT = MathJax.Extension.MathEvents.Event;
+ MathJax.Ajax.Require("[MathJax]/extensions/MathEvents.js",function () {
+ var EVENT = MathJax.Extension.MathEvents.Event
+ HUB = MathJax.Hub;
error.oncontextmenu = EVENT.Menu;
error.onmousedown = EVENT.Mousedown;
- error.onkeydown = EVENT.Keydown;
- error.tabIndex = this.getTabOrder(this.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));
- });
- }
+ error.keydown = EVENT.Keydown;
+ error.tabIndex = HUB.getTabOrder(HUB.getJaxFor(script));
+ });
//
// 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);
if (script.MathJax.preview) {script.MathJax.preview.innerHTML = ""}
//