Simple addressbook

This commit is contained in:
Gustavo Maximiliano Cortez 2015-10-22 18:43:32 -03:00
commit 6dd8b98dfc
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
12 changed files with 352 additions and 66 deletions

View file

@ -162,27 +162,25 @@ angular.module('copayApp.directives')
}
}
})
.directive('contact', function() {
.directive('contact', ['addressbookService', function(addressbookService) {
return {
restrict: 'E',
link: function(scope, element, attrs) {
if (!scope.wallet) return;
var address = attrs.address;
var contact = scope.wallet.addressBook[address];
if (contact && !contact.hidden) {
element.append(contact.label);
element.attr('tooltip', attrs.address);
} else {
element.append(address);
}
var addr = attrs.address;
addressbookService.getLabel(addr, function(label) {
if (label) {
element.append(label);
} else {
element.append(addr);
}
});
element.bind('click', function() {
selectText(element[0]);
});
}
};
})
}])
.directive('highlightOnChange', function() {
return {
restrict: 'A',