Focuses popup windows.

This commit is contained in:
zorkow 2015-08-29 01:57:33 +01:00
parent 189d4a8a81
commit 986ee52e8a
2 changed files with 11 additions and 6 deletions

View File

@ -101,7 +101,7 @@
HELP.Post = function () {
this.div = MENU.Background(this);
var help = HTML.addElement(this.div,"div",{
id: "MathJax_Help"
id: "MathJax_Help", tabIndex: "0"
},LOCALE._("HelpDialog",[
["b",{style:{fontSize:"120%"}},[["Help","MathJax Help"]]],
["div",{id: "MathJax_HelpContent"},[
@ -148,10 +148,13 @@
]
]],
["a",{href:"http://www.mathjax.org/"},["www.mathjax.org"]],
["span",{id: "MathJax_HelpClose", onclick: HELP.Remove},
["span",{id: "MathJax_HelpClose", onclick: HELP.Remove,
onkeydown: HELP.Remove, tabIndex: '0',
'aria-label': 'Close', 'aria-describedby': 'Close window'},
[["span",{},["\u00D7"]]]
]
]));
help.focus();
LOCALE.setCSS(help);
var doc = (document.documentElement||{});
var H = window.innerHeight || doc.clientHeight || doc.scrollHeight || 0;

View File

@ -477,7 +477,6 @@
/*
* Keyboard navigation of menu.
*/
active: null, // The currently focused item. There can only be one! HTML!
posted: false, // Is a menu open?
GetNode: function(jax) {
@ -746,7 +745,6 @@
},
Label: function (def,menu) {return [this.Name()]},
//TODO: Focus the popup.
Mouseup: function (event,menu) {
if (!this.disabled) {
this.Remove(event,menu);
@ -973,7 +971,7 @@
]]);
MENU.About.div = MENU.Background(MENU.About);
var about = HTML.addElement(MENU.About.div,"div",{
id: "MathJax_About"
id: "MathJax_About", tabIndex:0
},[
["b",{style:{fontSize:"120%"}},["MathJax"]]," v"+MathJax.version,["br"],
_(font.replace(/ /g,""),"using "+font),["br"],["br"],
@ -983,9 +981,13 @@
"background-color":"#E4E4E4", padding:".4em .6em", border:"1px inset"
}},jax],["br"],["br"],
["a",{href:"http://www.mathjax.org/"},["www.mathjax.org"]],
["span",{className:"MathJax_MenuClose",id:"MathJax_AboutClose",onclick:MENU.About.Remove},
["span",{className:"MathJax_MenuClose",id:"MathJax_AboutClose",
onclick:MENU.About.Remove,
onkeydown:MENU.About.Remove, tabIndex:0,
'aria-label': "Close", 'aria-describedby': "Close window"},
[["span",{},"\u00D7"]]]
]);
about.focus();
MathJax.Localization.setCSS(about);
var doc = (document.documentElement||{});
var H = window.innerHeight || doc.clientHeight || doc.scrollHeight || 0;