commit 986ee52e8a4c38d0d85f909badf193c41a3a7599
parent 189d4a8a81fe6e3484879ed71e14344520e61aef
Author: zorkow <volker.sorge@gmail.com>
Date: Sat, 29 Aug 2015 01:57:33 +0100
Focuses popup windows.
Diffstat:
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/unpacked/extensions/HelpDialog.js b/unpacked/extensions/HelpDialog.js
@@ -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;
diff --git a/unpacked/extensions/MathMenu.js b/unpacked/extensions/MathMenu.js
@@ -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;