Merge pull request #733 from yemel/feature/display-address-label

Add directive to render address from the book with a tooltip
This commit is contained in:
Gustavo Maximiliano Cortez 2014-06-24 10:53:40 -03:00
commit 621dcc1d09
3 changed files with 52 additions and 4 deletions

View file

@ -122,6 +122,23 @@ angular.module('copayApp.directives')
}
}
})
.directive('contact', function() {
return {
restrict: 'E',
link:function(scope, element, attrs) {
if (!scope.wallet) return;
var address = attrs.address;
var contact = scope.wallet.addressBook[address];
if (contact) {
element.append(contact.label);
attrs['tooltip'] = attrs.address;
} else {
element.append(address);
}
}
};
})
.directive('highlightOnChange', function() {
return {
restrict: 'A',