Don't show focus on dialog boxes opened by mouse events (only keyboard), and don't show focus for close icon when clicking with mouse

This commit is contained in:
Davide P. Cervone 2015-09-12 10:08:50 -04:00
parent 0cf2a52745
commit 8645c8ce94
2 changed files with 20 additions and 6 deletions

View File

@ -58,6 +58,9 @@
"-khtml-box-shadow":"0px 10px 20px #808080", // Konqueror
filter: "progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')" // IE
},
"#MathJax_Help.MathJax_MousePost": {
outline:"none"
},
"#MathJax_HelpContent": {
overflow:"auto", "text-align":"left", "font-size":"80%",
@ -93,6 +96,9 @@
},
"#MathJax_HelpClose:hover span": {
"background-color":"#CCC!important"
},
"#MathJax_HelpClose:hover:focus": {
outline:"none"
}
}
});
@ -100,11 +106,11 @@
/*
* Handle the Help Dialog box
*/
HELP.Dialog = function () {
LOCALE.loadDomain("HelpDialog",["Post",HELP]);
HELP.Dialog = function (event) {
LOCALE.loadDomain("HelpDialog",["Post",HELP,event]);
};
HELP.Post = function () {
HELP.Post = function (event) {
this.div = MENU.Background(this);
var help = HTML.addElement(this.div,"div",{
id: "MathJax_Help", tabIndex: 0, onkeydown: HELP.Keydown
@ -160,6 +166,7 @@
[["span",{},["\u00D7"]]]
]
]));
if (event.type === "mouseup") help.className += " MathJax_MousePost";
help.focus();
LOCALE.setCSS(help);
var doc = (document.documentElement||{});

View File

@ -93,6 +93,9 @@
"-khtml-box-shadow":"0px 10px 20px #808080", // Konqueror
filter: "progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')" // IE
},
"#MathJax_About.MathJax_MousePost": {
outline:"none"
},
".MathJax_Menu": {
position:"absolute", "background-color":"white", color:"black",
@ -202,6 +205,9 @@
},
".MathJax_MenuClose:hover span": {
"background-color":"#CCC!important"
},
".MathJax_MenuClose:hover:focus": {
outline:"none"
}
}
});
@ -1001,7 +1007,7 @@
/*
* Handle the ABOUT box
*/
MENU.About = function () {
MENU.About = function (event) {
var HTMLCSS = OUTPUT["HTML-CSS"] || {};
var font = MENU.About.GetFont();
var format = MENU.About.GetFormat();
@ -1034,6 +1040,7 @@
"aria-label": "Close", "aria-describedby": _("CloseWindow","Close window")},
[["span",{},"\u00D7"]]]
]);
if (event.type === "mouseup") about.className += " MathJax_MousePost";
about.focus();
MathJax.Localization.setCSS(about);
var doc = (document.documentElement||{});
@ -1088,9 +1095,9 @@
/*
* Handle the MathJax HELP menu
*/
MENU.Help = function () {
MENU.Help = function (event) {
AJAX.Require("[MathJax]/extensions/HelpDialog.js",
function () {MathJax.Extension.Help.Dialog()});
function () {MathJax.Extension.Help.Dialog({type:event.type})});
};
/*