Fix inTabOrder menu action, change default, and factor out code for setting/unsetting the tab index (in case the page author wants to call it.
This commit is contained in:
parent
a1bfe0afcf
commit
7df65c9d7a
|
@ -1896,7 +1896,7 @@ MathJax.Hub = {
|
||||||
mpContext: false, // true means pass menu events to MathPlayer in IE
|
mpContext: false, // true means pass menu events to MathPlayer in IE
|
||||||
mpMouse: false, // true means pass mouse events to MathPlayer in IE
|
mpMouse: false, // true means pass mouse events to MathPlayer in IE
|
||||||
texHints: true, // include class names for TeXAtom elements
|
texHints: true, // include class names for TeXAtom elements
|
||||||
inTabOrder: false, // set to false if math elements should be included in the tabindex
|
inTabOrder: true, // set to false if math elements should be included in the tabindex
|
||||||
semantics: false // add semantics tag with original form in MathML output
|
semantics: false // add semantics tag with original form in MathML output
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -544,26 +544,12 @@
|
||||||
MENU.FocusNode(menu);
|
MENU.FocusNode(menu);
|
||||||
},
|
},
|
||||||
Activate: function(event, menu) {
|
Activate: function(event, menu) {
|
||||||
var jaxs = MENU.AllNodes();
|
MENU.UnsetTabIndex();
|
||||||
for (var j = 0, jax; jax = jaxs[j]; j++) {
|
|
||||||
if (jax.tabIndex > 0) {
|
|
||||||
jax.oldTabIndex = jax.tabIndex;
|
|
||||||
}
|
|
||||||
jax.tabIndex = -1;
|
|
||||||
}
|
|
||||||
MENU.posted = true;
|
MENU.posted = true;
|
||||||
},
|
},
|
||||||
Unfocus: function() {
|
Unfocus: function() {
|
||||||
MENU.ActiveNode().tabIndex = -1;
|
MENU.ActiveNode().tabIndex = -1;
|
||||||
var jaxs = MENU.AllNodes();
|
MENU.SetTabIndex();
|
||||||
for (var j = 0, jax; jax = jaxs[j]; j++) {
|
|
||||||
if (jax.oldTabIndex !== undefined) {
|
|
||||||
jax.tabIndex = jax.oldTabIndex
|
|
||||||
delete jax.oldTabIndex;
|
|
||||||
} else {
|
|
||||||
jax.tabIndex = HUB.getTabOrder();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MENU.FocusNode(MENU.CurrentNode());
|
MENU.FocusNode(MENU.CurrentNode());
|
||||||
MENU.posted = false;
|
MENU.posted = false;
|
||||||
},
|
},
|
||||||
|
@ -585,6 +571,26 @@
|
||||||
Left: function(event, menu) {
|
Left: function(event, menu) {
|
||||||
MENU.MoveHorizontal(event, menu, function(x) {return x - 1;});
|
MENU.MoveHorizontal(event, menu, function(x) {return x - 1;});
|
||||||
},
|
},
|
||||||
|
UnsetTabIndex: function () {
|
||||||
|
var jaxs = MENU.AllNodes();
|
||||||
|
for (var j = 0, jax; jax = jaxs[j]; j++) {
|
||||||
|
if (jax.tabIndex > 0) {
|
||||||
|
jax.oldTabIndex = jax.tabIndex;
|
||||||
|
}
|
||||||
|
jax.tabIndex = -1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
SetTabIndex: function () {
|
||||||
|
var jaxs = MENU.AllNodes();
|
||||||
|
for (var j = 0, jax; jax = jaxs[j]; j++) {
|
||||||
|
if (jax.oldTabIndex !== undefined) {
|
||||||
|
jax.tabIndex = jax.oldTabIndex
|
||||||
|
delete jax.oldTabIndex;
|
||||||
|
} else {
|
||||||
|
jax.tabIndex = HUB.getTabOrder();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
//TODO: Move to utility class.
|
//TODO: Move to utility class.
|
||||||
// Computes a mod n.
|
// Computes a mod n.
|
||||||
|
@ -1336,6 +1342,9 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Toggle assistive MML settings
|
||||||
|
*/
|
||||||
MENU.AssistiveMML = function (item,restart) {
|
MENU.AssistiveMML = function (item,restart) {
|
||||||
var AMML = MathJax.Extension.AssistiveMML;
|
var AMML = MathJax.Extension.AssistiveMML;
|
||||||
if (!AMML) {
|
if (!AMML) {
|
||||||
|
@ -1543,7 +1552,7 @@
|
||||||
ITEM.RULE(),
|
ITEM.RULE(),
|
||||||
ITEM.CHECKBOX("Fast Preview", "FastPreview"),
|
ITEM.CHECKBOX("Fast Preview", "FastPreview"),
|
||||||
ITEM.CHECKBOX("Assistive MathML", "assistiveMML", {action:MENU.AssistiveMML}),
|
ITEM.CHECKBOX("Assistive MathML", "assistiveMML", {action:MENU.AssistiveMML}),
|
||||||
ITEM.CHECKBOX("Include in Tab Order", "inTabOrder", {action:CONFIG.inTabOrder})
|
ITEM.CHECKBOX("Include in Tab Order", "inTabOrder")
|
||||||
),
|
),
|
||||||
ITEM.SUBMENU("MathPlayer", {hidden:!HUB.Browser.isMSIE || !CONFIG.showMathPlayer,
|
ITEM.SUBMENU("MathPlayer", {hidden:!HUB.Browser.isMSIE || !CONFIG.showMathPlayer,
|
||||||
disabled:!HUB.Browser.hasMathPlayer},
|
disabled:!HUB.Browser.hasMathPlayer},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user