(js) Set height/width of gravatar's image
This commit is contained in:
parent
6a835c745f
commit
11cf483e2c
|
@ -16,9 +16,11 @@
|
||||||
restrict: 'AE',
|
restrict: 'AE',
|
||||||
replace: true,
|
replace: true,
|
||||||
required: 'email',
|
required: 'email',
|
||||||
template: '<img ng-src="{{url}}" />',
|
template: '<img ng-src="{{url}}"/>',
|
||||||
link: function(scope, element, attrs) {
|
link: function(scope, element, attrs) {
|
||||||
var size = attrs.size;
|
var size = attrs.size;
|
||||||
|
element.attr('width', size);
|
||||||
|
element.attr('height', size);
|
||||||
attrs.$observe('email', function(value) {
|
attrs.$observe('email', function(value) {
|
||||||
if (!value) { return; }
|
if (!value) { return; }
|
||||||
scope.url = Gravatar(value, size);
|
scope.url = Gravatar(value, size);
|
||||||
|
|
Loading…
Reference in a new issue