DEV: Fix position of avatar flair to be based on the actual avatar. (#15226)
Previously, it was based on the container of the avatar. However, the container of the avatar can be extended to contain more than just the avatar itself. This resulted in the positioning of the avatar flair to be off.
This commit is contained in:
parent
dea56ed953
commit
ae88b52370
|
@ -186,18 +186,22 @@ createWidget("post-avatar", {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = [body];
|
const postAvatarBody = [body];
|
||||||
|
|
||||||
if (attrs.flair_url || attrs.flair_bg_color) {
|
if (attrs.flair_url || attrs.flair_bg_color) {
|
||||||
result.push(this.attach("avatar-flair", attrs));
|
postAvatarBody.push(this.attach("avatar-flair", attrs));
|
||||||
} else {
|
} else {
|
||||||
const autoFlairAttrs = autoGroupFlairForUser(this.site, attrs);
|
const autoFlairAttrs = autoGroupFlairForUser(this.site, attrs);
|
||||||
|
|
||||||
if (autoFlairAttrs) {
|
if (autoFlairAttrs) {
|
||||||
result.push(this.attach("avatar-flair", autoFlairAttrs));
|
postAvatarBody.push(this.attach("avatar-flair", autoFlairAttrs));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
result.push(h("div.poster-avatar-extra"));
|
const result = [
|
||||||
|
h("div.post-avatar", postAvatarBody),
|
||||||
|
h("div.poster-avatar-extra"),
|
||||||
|
];
|
||||||
|
|
||||||
if (this.settings.displayPosterName) {
|
if (this.settings.displayPosterName) {
|
||||||
result.push(this.attach("post-avatar-user-info", attrs));
|
result.push(this.attach("post-avatar-user-info", attrs));
|
||||||
|
|
|
@ -482,6 +482,7 @@ aside.quote {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.post-avatar,
|
||||||
.topic-avatar,
|
.topic-avatar,
|
||||||
.user-card-avatar {
|
.user-card-avatar {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
Loading…
Reference in New Issue