Skip to content

Commit 8d91297

Browse files
committed
Prevent avatar image in avatar prompt option for initials
1 parent eab3a63 commit 8d91297

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

client/views/avatar/avatar.coffee

+8-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,15 @@ Template.avatar.helpers
1515
return colors[position]
1616

1717
imageUrl: ->
18+
if this.preventImage?
19+
return
20+
1821
username = this.username
1922
random = Session.get('AvatarRandom')
2023
if not username? and this.userId?
2124
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});"

client/views/avatar/avatar.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template name="avatar">
22
<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}}">
44
</div>
55
</div>
66
</template>

client/views/avatar/avatarPrompt.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ <h2>{{_ "avatar.Select_an_avatar"}}</h2>
2828
<div class="avatar-suggestions">
2929
{{#if suggestions.ready}}
3030
<div class="avatar-suggestion-item">
31-
{{> avatar username=username}}
31+
{{> avatar username=username preventImage='true'}}
3232
{{#with service='initials'}}
3333
<button type="button" class="button primary select-service">{{_ "avatar.Use_initials_avatar" }}</button>
3434
{{/with}}

0 commit comments

Comments
 (0)