Simple addressbook
This commit is contained in:
parent
597e9cec23
commit
6dd8b98dfc
12 changed files with 352 additions and 66 deletions
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue