Skip to content

Commit 159f41d

Browse files
author
Jen Lampton
committed
Issue #38: Add aria attributes with approproate warning for new windows.
1 parent e68ae3c commit 159f41d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

on_the_web.theme.inc

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ function theme_on_the_web_item($variables) {
3333
$attributes = array(
3434
'class' => $link_classes,
3535
'title' => $title,
36+
'aria-label' => $title,
3637
'rel' => 'nofollow',
3738
);
3839
if ($target == TRUE) {
3940
$attributes['target'] = '_blank';
41+
$attributes['aria-label'] .= ' (' . t('opens in new window') . ')';
4042
}
4143
$options = array('attributes' => $attributes, 'html' => TRUE);
4244

@@ -65,7 +67,7 @@ function theme_on_the_web_item($variables) {
6567
$icon_classes[] = 'fa-2x';
6668
}
6769

68-
$text = '<i class="' . implode(' ', $icon_classes) . '"></i>';
70+
$text = '<i aria-hidden="true" class="' . implode(' ', $icon_classes) . '"></i>';
6971

7072
return l($text, $link, $options);
7173
}

0 commit comments

Comments
 (0)