Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat(address): migrated copy address to clipboard feature for tables …
…with transactions
  • Loading branch information
beregovoy68 committed Oct 31, 2016
1 parent 8ab2ddd commit 6282cde
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/js/shared/transaction.filter.js
@@ -1,7 +1,7 @@
(function () {
'use strict';

function TransactionFilter(applicationContext, formattingService) {
function TransactionFilter(applicationContext, formattingService, addressService) {
var TRANSACTION_TYPES = {
2: 'Payment'
};
Expand Down Expand Up @@ -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;
}

Expand All @@ -45,7 +48,7 @@
};
}

TransactionFilter.$inject = ['applicationContext', 'formattingService'];
TransactionFilter.$inject = ['applicationContext', 'formattingService', 'addressService'];

angular
.module('app.shared')
Expand Down
6 changes: 4 additions & 2 deletions src/main.html
Expand Up @@ -423,8 +423,10 @@ <h2>SEND PAYMENT</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>
Expand Down

0 comments on commit 6282cde

Please sign in to comment.