MDL-31976 Accessbility: Action icons on course page do not need title attributes

This commit is contained in:
Frederic Massart 2012-09-11 14:53:15 +08:00
parent a3ab18c735
commit aad982aa24
5 changed files with 22 additions and 27 deletions

View file

@ -550,6 +550,10 @@ class pix_icon implements renderable {
}
if (!isset($this->attributes['title'])) {
$this->attributes['title'] = $this->attributes['alt'];
} else if (empty($this->attributes['title'])) {
// Remove the title attribute if empty, we probably want to use the parent node's title
// and some browsers might overwrite it with an empty title.
unset($this->attributes['title']);
}
}
}