Skip to content

Commit

Permalink
Fix ugly avatar loading in presence screen
Browse files Browse the repository at this point in the history
This fixes #18
  • Loading branch information
ignisf committed Jul 21, 2014
1 parent 4dc964a commit d61b756
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions app/assets/javascripts/presence.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$(document).on "page:change", ->
$('#presence .avatar img').on 'load', ->
$(this).parent().fadeIn()
.each ->
if $(this).complete
$(this).trigger 'load'
4 changes: 3 additions & 1 deletion app/assets/stylesheets/base/_base.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,6 @@ a.button, a:focus.button, a:hover.button, a:visited.button {
z-index: 1;
display: none;
}
}
}

#presence .avatar { display: none; }
2 changes: 1 addition & 1 deletion app/views/users/_user.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<li>
<span class="avatar">
<%= image_tag "//www.gravatar.com/avatar/#{user.email_md5}?s=50&d=retro" %>
<%= image_tag "//www.gravatar.com/avatar/#{user.email_md5}?s=50&d=retro", alt: user.name %>
</span>
<span class="info">
<% if user.url.present? %>
Expand Down

0 comments on commit d61b756

Please sign in to comment.