Skip to content

Commit

Permalink
Fixed query bug from pull #4
Browse files Browse the repository at this point in the history
The current code will remove other instances of the icon if it appears more than once on the page.
  • Loading branch information
neilellis committed May 1, 2013
1 parent 7c3ff07 commit f4c994b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gravatar-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ angular.module('ui-gravatar', ['md5']).
// construct the tag to insert into the element
var tag = '<img class="gravatar-icon" src="' + (attrs.secure ? 'https://secure' : 'http://www' ) + '.gravatar.com/avatar/' + hash + '?s=' + size + '&r=' + rating + '&d=' + defaultUrl + '" >'
//remove any existing imgs
$(".gravatar-icon").remove();
$(elm).find(".gravatar-icon").remove();
// insert the tag into the element
elm.append(tag);
}
Expand Down

0 comments on commit f4c994b

Please sign in to comment.