MDL-30833 Accessibility: Added aria-expanded attribute on navigation nodes
This commit is contained in:
@@ -121,18 +121,20 @@ class block_navigation_renderer extends plugin_renderer_base {
|
||||
|
||||
// this applies to the li item which contains all child lists too
|
||||
$liclasses = array($item->get_css_type(), 'depth_'.$depth);
|
||||
$liexpandable = array();
|
||||
if ($item->has_children() && (!$item->forceopen || $item->collapse)) {
|
||||
$liclasses[] = 'collapsed';
|
||||
}
|
||||
if ($isbranch) {
|
||||
$liclasses[] = 'contains_branch';
|
||||
$liexpandable = array('aria-expanded' => in_array('collapsed', $liclasses) ? "false" : "true");
|
||||
} else if ($hasicon) {
|
||||
$liclasses[] = 'item_with_icon';
|
||||
}
|
||||
if ($item->isactive === true) {
|
||||
$liclasses[] = 'current_branch';
|
||||
}
|
||||
$liattr = array('class'=>join(' ',$liclasses));
|
||||
$liattr = array('class' => join(' ',$liclasses)) + $liexpandable;
|
||||
// class attribute on the div item which only contains the item content
|
||||
$divclasses = array('tree_item');
|
||||
if ($isbranch) {
|
||||
|
||||
Reference in New Issue
Block a user