mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
A11Y: Add href
to frequent poster avatars (#18627)
This commit is contained in:
parent
1b22ff461b
commit
de9ed8792a
1 changed files with 6 additions and 2 deletions
|
@ -5,6 +5,7 @@ import { createWidget } from "discourse/widgets/widget";
|
||||||
import { h } from "virtual-dom";
|
import { h } from "virtual-dom";
|
||||||
import { replaceEmoji } from "discourse/widgets/emoji";
|
import { replaceEmoji } from "discourse/widgets/emoji";
|
||||||
import autoGroupFlairForUser from "discourse/lib/avatar-flair";
|
import autoGroupFlairForUser from "discourse/lib/avatar-flair";
|
||||||
|
import { userPath } from "discourse/lib/url";
|
||||||
|
|
||||||
const LINKS_SHOWN = 5;
|
const LINKS_SHOWN = 5;
|
||||||
|
|
||||||
|
@ -87,12 +88,15 @@ createWidget("topic-participant", {
|
||||||
linkContents.push(this.attach("avatar-flair", autoFlairAttrs));
|
linkContents.push(this.attach("avatar-flair", autoFlairAttrs));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return h(
|
return h(
|
||||||
"a.poster.trigger-user-card",
|
"a.poster.trigger-user-card",
|
||||||
{
|
{
|
||||||
className: state.toggled ? "toggled" : null,
|
className: state.toggled ? "toggled" : null,
|
||||||
attributes: { title: attrs.username, "data-user-card": attrs.username },
|
attributes: {
|
||||||
|
title: attrs.username,
|
||||||
|
"data-user-card": attrs.username,
|
||||||
|
href: userPath(attrs.username),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
linkContents
|
linkContents
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue