Do not add aria-label to icons and images with titles if aria-hidden is set
This commit is contained in:
parent
f2259557c8
commit
4f0bddd7da
|
@ -32,7 +32,7 @@ class Help extends Zend_Form_Decorator_Abstract
|
|||
*
|
||||
* @param bool $state
|
||||
*
|
||||
* @return Feedback
|
||||
* @return Help
|
||||
*/
|
||||
public function setAccessible($state = true)
|
||||
{
|
||||
|
@ -85,7 +85,7 @@ class Help extends Zend_Form_Decorator_Abstract
|
|||
. '</span>' . $content;
|
||||
}
|
||||
|
||||
$content = $this->getView()->icon('help', $description) . $content;
|
||||
$content = $this->getView()->icon('help', $description, array('aria-hidden' => 'true')) . $content;
|
||||
}
|
||||
|
||||
return $content;
|
||||
|
|
|
@ -54,7 +54,7 @@ $this->addHelperFunction('img', function ($url, $params = null, array $propertie
|
|||
}
|
||||
|
||||
if (array_key_exists('title', $properties)) {
|
||||
if (! array_key_exists('aria-label', $properties)) {
|
||||
if (! array_key_exists('aria-label', $properties) && !array_key_exists('aria-hidden', $properties)) {
|
||||
$properties['aria-label'] = $properties['title'];
|
||||
}
|
||||
} elseif (! array_key_exists('aria-hidden', $properties)) {
|
||||
|
@ -83,7 +83,7 @@ $this->addHelperFunction('icon', function ($img, $title = null, array $propertie
|
|||
$properties['role'] = 'img';
|
||||
$properties['title'] = $title;
|
||||
|
||||
if (! array_key_exists('aria-label', $properties)) {
|
||||
if (! array_key_exists('aria-label', $properties) && !array_key_exists('aria-hidden', $properties)) {
|
||||
$properties['aria-label'] = $title;
|
||||
}
|
||||
} elseif (! array_key_exists('aria-hidden', $properties)) {
|
||||
|
|
Loading…
Reference in New Issue