Permalink
Browse files

feat(address): migrated copy address to clipboard feature for tables …

…with transactions
  • Loading branch information...
1 parent 8ab2ddd commit 6282cde559c91549a2c9bb47698c9331b5670bb9 @beregovoy68 beregovoy68 committed Oct 31, 2016
Showing with 9 additions and 4 deletions.
  1. +5 −2 src/js/shared/transaction.filter.js
  2. +4 −2 src/main.html
@@ -1,7 +1,7 @@
(function () {
'use strict';
- function TransactionFilter(applicationContext, formattingService) {
+ function TransactionFilter(applicationContext, formattingService, addressService) {
var TRANSACTION_TYPES = {
2: 'Payment'
};
@@ -37,6 +37,9 @@
fee: fee.formatAmount(true)
};
+ transaction.formatted.isSenderCopiable = addressService.validateAddress(transaction.formatted.sender);
+ transaction.formatted.isRecipientCopiable = addressService.validateAddress(transaction.formatted.recipient);
+
return transaction;
}
@@ -45,7 +48,7 @@
};
}
- TransactionFilter.$inject = ['applicationContext', 'formattingService'];
+ TransactionFilter.$inject = ['applicationContext', 'formattingService', 'addressService'];
angular
.module('app.shared')
View
@@ -423,8 +423,10 @@ <h2 id="AccHeader">{{accounts.caption}}</h2>
<tr ng-repeat="tx in wallet.transactions | orderBy:'timestamp':true | limitTo:10 | transaction track by tx.timestamp" ng-class="{'wavesTable-txUnc': tx.unconfirmed, 'wavesTable-txIn': !tx.formatted.isOutgoing, 'wavesTable-txOut': tx.formatted.isOutgoing}">
<td>{{tx.formatted.datetime}}</td>
<td>{{tx.formatted.type}}</td>
- <td>{{tx.formatted.sender}}</td>
- <td>{{tx.formatted.recipient}}</td>
+ <td ng-if="!tx.formatted.isSenderCopiable">{{tx.formatted.sender}}</td>
+ <td ng-if="tx.formatted.isSenderCopiable"><span class="clipSpan" tooltipster tooltip-theme="tooltipster-theme1" ngclipboard data-clipboard-text="{{tx.formatted.sender}}" title="Copy this address to the clipboard." ngclipboard-success="clipboardOk()">{{tx.formatted.sender}}</span></td>
+ <td ng-if="!tx.formatted.isRecipientCopiable">{{tx.formatted.recipient}}</td>
+ <td ng-if="tx.formatted.isRecipientCopiable"><span class="clipSpan" tooltipster tooltip-theme="tooltipster-theme1" ngclipboard data-clipboard-text="{{tx.formatted.recipient}}" title="Copy this address to the clipboard." ngclipboard-success="clipboardOk()">{{tx.formatted.recipient}}</span></td>
<td>{{tx.formatted.fee}}</td>
<td>{{tx.formatted.amount}}</td>
</tr>

0 comments on commit 6282cde

Please sign in to comment.