Commit 9638ec17 authored by Dave Lane's avatar Dave Lane

fixed tab ordering, and shifting keyboard focus to first menu button or first...

fixed tab ordering, and shifting keyboard focus to first menu button or first input element or default button if there's no input
parent c6b88bb1
......@@ -86,7 +86,6 @@ article.ore-form .container .entry-content > div.ore {
text-decoration: none;
}
#ore-container .button:visited { text-decoration: none; }
/* end buttons */
/* start links */
......@@ -317,6 +316,11 @@ button.ore-processing {
#ore-login-status .ore-trigger:focus {
color: black;
}
#ore-container .ore-button {
color: black;
}
/*#ore-login-status button.button:focus {
box-shadow: 0 2px 2px rgb(0,0,0,0.5);
......
......@@ -219,9 +219,11 @@ jQuery(document).ready(function() {
// Process Menu Click Events
LOG('setting $this.next to $next...');
$next = $(this).next();
// give the modal popup focus...
$next.focus();
// give the modal popup's frst button focus...
$next.find('button:first').focus();
// transfer tab advancing to the menu...
$next.attr('tabindex', '0');
// be able to accept keyboard clicks.
$next.click( function (e) {
LOG('click in menu - this should be passed on!')
//LOG('this = ', $(this));
......@@ -666,6 +668,21 @@ function show_modal(id) {
} else {
LOG('found no forms');
}
// ensure form modal has focus for keyboard navigation
LOG('setting focus to form ', form);
LOG('form id = '+ current_modal);
// if it's an input form, set focus on the first field, or...
if (form.find('input').length !== 0) {
LOG('setting focus on first input...');
form.find('input:first').focus();
} else if (form.find('button').length !==0) { // if not, set focus on the first button
LOG('setting focus on first button...');
form.find('button.ore-default').focus();
} else {
LOG('not setting focus because no inputs or buttons');
}
form.attr('tabindex', '0');
//
LOG('modal '+current_modal+' should be visible...');
return true;
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment