File tree 3 files changed +10
-4
lines changed
3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,15 @@ Template.avatar.helpers
15
15
return colors[position]
16
16
17
17
imageUrl : ->
18
+ if this .preventImage ?
19
+ return
20
+
18
21
username = this .username
19
22
random = Session .get (' AvatarRandom' )
20
23
if not username? and this .userId ?
21
24
username = Meteor .users .findOne (this .userId )? .username
22
- url = " #{ Meteor .absoluteUrl ()} avatar/#{ username} .jpg?_dc=#{ random} "
23
- return url
25
+
26
+ if not username?
27
+ return
28
+
29
+ return " background-image:url(#{ Meteor .absoluteUrl ()} avatar/#{ username} .jpg?_dc=#{ random} );"
Original file line number Diff line number Diff line change 1
1
< template name ="avatar ">
2
2
< div class ="avatar " initials ="{{initials}} " style ="background-color:{{color}} ">
3
- < div class ="avatar-image " style ="background-image:url( {{imageUrl}}); ">
3
+ < div class ="avatar-image " style ="{{imageUrl}} ">
4
4
</ div >
5
5
</ div >
6
6
</ template >
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ <h2>{{_ "avatar.Select_an_avatar"}}</h2>
28
28
< div class ="avatar-suggestions ">
29
29
{{#if suggestions.ready}}
30
30
< div class ="avatar-suggestion-item ">
31
- {{> avatar username=username}}
31
+ {{> avatar username=username preventImage='true' }}
32
32
{{#with service='initials'}}
33
33
< button type ="button " class ="button primary select-service "> {{_ "avatar.Use_initials_avatar" }}</ button >
34
34
{{/with}}
You can’t perform that action at this time.
0 commit comments