Add directive to render address from the book with a tooltip
This commit is contained in:
parent
4d6e9f8a6d
commit
099a282fb9
3 changed files with 52 additions and 4 deletions
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue