Permalink
Browse files

MDL-27428 accessibility : made navigation and settings menu category …

…span nodes navigable using tabs with tabindex=0
  • Loading branch information...
1 parent 1e22cd3 commit 32561cafd480d00d7eead3c51a6cf33069756af5 @nebgor nebgor committed with Sam Hemelryk May 10, 2011
Showing with 3 additions and 2 deletions.
  1. +1 −0 blocks/navigation/renderer.php
  2. +2 −2 lib/outputrenderers.php
@@ -52,6 +52,7 @@ protected function navigation_node($items, $attrs=array(), $expansionlimit=null,
$attributes['class'] = 'dimmed_text';
}
if (is_string($item->action) || empty($item->action) || ($item->type === navigation_node::TYPE_CATEGORY && empty($options['linkcategories']))) {
+ $attributes['tabindex'] = '0'; //add tab support to span but still maintain character stream sequence.
$content = html_writer::tag('span', $content, $attributes);
} else if ($item->action instanceof action_link) {
//TODO: to be replaced with something else
View
@@ -2424,7 +2424,7 @@ protected function render_navigation_node(navigation_node $item) {
$content = $icon.$content; // use CSS for spacing of icons
}
if ($item->helpbutton !== null) {
- $content = trim($item->helpbutton).html_writer::tag('span', $content, array('class'=>'clearhelpbutton'));
+ $content = trim($item->helpbutton).html_writer::tag('span', $content, array('class'=>'clearhelpbutton', 'tabindex'=>'0'));
}
if ($content === '') {
return '';
@@ -2447,7 +2447,7 @@ protected function render_navigation_node(navigation_node $item) {
$content = html_writer::link($item->action, $content, $attributes);
} else if (is_string($item->action) || empty($item->action)) {
- $attributes = array();
+ $attributes = array('tabindex'=>'0'); //add tab support to span but still maintain character stream sequence.
if ($title !== '') {
$attributes['title'] = $title;
}

0 comments on commit 32561ca

Please sign in to comment.