(js) Set height/width of gravatar's image

pull/91/head
Francis Lachapelle 2015-05-28 10:56:27 -04:00
parent 6a835c745f
commit 11cf483e2c
1 changed files with 3 additions and 1 deletions

View File

@ -16,9 +16,11 @@
restrict: 'AE',
replace: true,
required: 'email',
template: '<img ng-src="{{url}}" />',
template: '<img ng-src="{{url}}"/>',
link: function(scope, element, attrs) {
var size = attrs.size;
element.attr('width', size);
element.attr('height', size);
attrs.$observe('email', function(value) {
if (!value) { return; }
scope.url = Gravatar(value, size);