Merge pull request #105 from cmgustavo/ref/design-28

Fix Address book directive. Adds gravatar
This commit is contained in:
Gustavo Maximiliano Cortez 2016-09-14 10:06:50 -03:00 committed by GitHub
commit 9f88d9a3cb
7 changed files with 53 additions and 4 deletions

View file

@ -9,6 +9,7 @@ var modules = [
'angular-clipboard',
'ngLodash',
'ngCsv',
'angular-md5',
'bwcModule',
'pbkdf2Module',
'copayApp.filters',

View file

@ -0,0 +1,20 @@
'use strict';
angular.module('copayApp.directives')
.directive('gravatar', function(md5) {
return {
restrict: 'AE',
replace: true,
scope: {
name: '@',
height: '@',
width: '@',
email: '@'
},
link: function(scope, el, attr) {
scope.emailHash = md5.createHash(scope.email || '');
},
template: '<img class="gravatar" alt="{{ name }}" height="{{ height }}" width="{{ width }}" src="https://secure.gravatar.com/avatar/{{ emailHash }}.jpg?s={{ width }}&d=mm">'
}
});