A11Y: Don't show title attr on post avatars (#10719)

This commit is contained in:
Kris 2020-09-22 16:21:21 -04:00 committed by GitHub
parent ce3fe2f4c4
commit 614e0bab57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -35,7 +35,12 @@ export function avatarImg(wanted, attrs) {
if (!url || url.length === 0) {
return;
}
const title = attrs.name || formatUsername(attrs.username);
let title;
if (!attrs.hideTitle) {
title = attrs.name || formatUsername(attrs.username);
}
let className =
"avatar" + (attrs.extraClasses ? " " + attrs.extraClasses : "");
@ -168,6 +173,7 @@ createWidget("post-avatar", {
name: attrs.name,
url: attrs.usernameUrl,
className: "main-avatar",
hideTitle: true,
});
}