Skip to content

Commit

Permalink
Fixes MDL-11695, Skip block links inaccessible for many keyboard-only…
Browse files Browse the repository at this point in the history
… users. Merged.
  • Loading branch information
nfreear committed Oct 12, 2007
1 parent b024b74 commit 3ab2630
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
8 changes: 3 additions & 5 deletions lib/weblib.php
Original file line number Diff line number Diff line change
Expand Up @@ -5926,15 +5926,13 @@ function print_side_block($heading='', $content='', $list=NULL, $icons=NULL, $fo
else {
$skip_text = get_string('skipa', 'access', strip_tags($title));
}
$skip_link = '<a href="#sb-'.$block_id.'" class="skip-block" title="'.$skip_text.'">'."\n".get_accesshide($skip_text)."\n".'</a>';
$skip_link = '<a href="#sb-'.$block_id.'" class="skip-block">'.$skip_text.'</a>';
$skip_dest = '<span id="sb-'.$block_id.'" class="skip-block-to"></span>';

if (! empty($heading)) {
$heading = $skip_link . $heading;
}
/*else { //ELSE: I think a single link on a page, "Skip block 4" is too confusing - don't print.
echo $skip_link;
}*/
}
//ELSE: a single link on a page "Skip block 4" is too confusing - ignore.

print_side_block_start($heading, $attributes);

Expand Down
15 changes: 8 additions & 7 deletions theme/standard/styles_layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -1178,14 +1178,15 @@ body#admin-modules table.generaltable td.c0
*** Blocks
***/

/*Accessibility: Skip block link, for screen reader users. */
a.skip-block, .skip-block {
display:block;
width:2em;
height:1px;
/*Accessibility: Skip block link, for keyboard-only users. */
a.skip-block {
position: absolute;
top: -1000em;
font-size: 0.85em;
}
.sideblock .skip-block {
height:4px;
a.skip-block:focus, a.skip-block:active {
position: static;
display: block;
}
.skip-block-to {
display: block;
Expand Down

0 comments on commit 3ab2630

Please sign in to comment.