@ -44,8 +44,11 @@ Template.avatarPrompt.events
template.getSuggestions()
'change .myFileInput': (event, template) ->
'change .avatar-file-input': (event, template) ->
FS.Utility.eachFile event, (blob) ->
file = new FS.File(blob)
if not file? or file.isImage() is false
return
reader = new FileReader()
reader.readAsDataURL(blob)
reader.onloadend = ->
@ -50,7 +50,7 @@
{{/with}}
{{#unless upload}}
<button type="button" class="button primary">{{_ "avatar.Select_file"}}
<input type="file" class="myFileInput">
<input type="file" class="avatar-file-input" accept="image/x-png, image/jpeg, image/jpg">
</button>
{{/unless}}
</div>