UX: displays avatar instead of icon on desktop

This commit is contained in:
jjaffeux 2020-05-19 10:51:20 +02:00
parent 6825dcd007
commit cddc0a2eb5
2 changed files with 9 additions and 7 deletions

View File

@ -23,7 +23,11 @@ function registerTopicFooterButtons(api) {
id: "assign", id: "assign",
icon() { icon() {
const hasAssignement = this.get("topic.assigned_to_user"); const hasAssignement = this.get("topic.assigned_to_user");
return hasAssignement ? "user-times" : "user-plus"; return hasAssignement
? this.site.mobileView
? "user-times"
: null
: "user-plus";
}, },
priority: 250, priority: 250,
translatedTitle() { translatedTitle() {
@ -49,10 +53,10 @@ function registerTopicFooterButtons(api) {
); );
} else { } else {
return htmlSafe( return htmlSafe(
`<span class="unassign-label">${label}</span>${renderAvatar(user, { `${renderAvatar(user, {
imageSize: "tiny", imageSize: "tiny",
ignoreTitle: true ignoreTitle: true
})}` })}<span class="unassign-label">${label}</span>`
); );
} }
} else { } else {

View File

@ -88,12 +88,10 @@
padding: 0 12px; padding: 0 12px;
.d-button-label { .d-button-label {
display: inline-flex;
align-items: center;
.avatar { .avatar {
margin-left: 0.25em; margin-right: 0.25em;
margin-top: -1px; margin-top: -1px;
vertical-align: sub;
} }
} }
} }