Add aria-label to modal link with title attribute

This commit is contained in:
Michael Vickers 2020-10-03 13:52:05 +01:00 committed by Frédéric Guillot
parent b24d05df76
commit 0cfc6162c5
1 changed files with 2 additions and 1 deletions

View File

@ -49,7 +49,8 @@ class ModalHelper extends Base
public function medium($icon, $label, $controller, $action, array $params = array(), $title = '') public function medium($icon, $label, $controller, $action, array $params = array(), $title = '')
{ {
$html = '<i class="fa fa-'.$icon.' fa-fw js-modal-medium" aria-hidden="true"></i>'.$label; $ariaLabel = (empty($title) ? 'aria-hidden="true"' : 'role="img" aria-label="'.$title.'"');
$html = '<i class="fa fa-'.$icon.' fa-fw js-modal-medium" '.$ariaLabel.'></i>'.$label;
return $this->helper->url->link($html, $controller, $action, $params, false, 'js-modal-medium', $title); return $this->helper->url->link($html, $controller, $action, $params, false, 'js-modal-medium', $title);
} }