FEATURE: add data-username on user-info blocks

This makes it easier to target in CSS
This commit is contained in:
Sam 2018-07-12 18:16:05 +10:00
parent 1f0bbca87e
commit 6bc0f97668
1 changed files with 4 additions and 1 deletions

View File

@ -7,6 +7,7 @@ function normalize(name) {
export default Ember.Component.extend({
classNameBindings: [":user-info", "size"],
attributeBindings: ["data-username"],
size: "small",
@computed("user.username")
@ -14,8 +15,10 @@ export default Ember.Component.extend({
return userPath(username);
},
"data-username": Em.computed.alias("user.username"),
// TODO: In later ember releases `hasBlock` works without this
hasBlock: Ember.computed.alias("template"),
hasBlock: Em.computed.alias("template"),
@computed("user.name", "user.username")
name(name, username) {