Merge pull request #1787 from isocolsky/pagination

WIP Tx history & pagination changes
This commit is contained in:
Matias Alejo Garcia 2014-11-13 08:09:54 -03:00
commit ff810a51cc
2 changed files with 14 additions and 7 deletions

View file

@ -1324,7 +1324,10 @@ Wallet.prototype.getPendingTxProposals = function() {
});
txp.outs = [];
_.each(addresses, function(value, address) {
txp.outs.push({address: address, value: value * satToUnit});
txp.outs.push({
address: address,
value: value * satToUnit
});
});
// extra fields
txp.fee = txp.builder.feeSat * satToUnit;
@ -2933,12 +2936,16 @@ Wallet.prototype.getTransactionHistory = function(opts, cb) {
tx.action = amount > 0 ? 'sent' : 'received';
}
var firstOut = _.findWhere(items, {
type: 'out'
});
if (tx.action == 'sent' || tx.action == 'moved') {
var firstOut = _.findWhere(items, {
type: 'out'
});
if (firstOut) {
tx.labelTo = firstOut.label;
tx.addressTo = firstOut.address;
}
};
tx.labelTo = firstOut ? firstOut.label : undefined;
tx.addressTo = firstOut ? firstOut.address : undefined;
tx.amountSat = Math.abs(amount);
tx.amount = tx.amountSat * satToUnit;
tx.minedTs = !_.isNaN(tx.time) ? tx.time * 1000 : undefined;

View file

@ -100,7 +100,7 @@
</div>
</div>
</div>
<pagination page="currentPage" total-items="totalItems" items-per-page="itemsPerPage" on-select-page="selectPage(page)" />
<pagination page="currentPage" total-items="totalItems" items-per-page="itemsPerPage" on-select-page="selectPage(page)" max-size="10" />
</div>
</div>
</div>