mirror of https://github.com/BTCPrivate/copay.git
Add pagination to transaction proposals All-tab
This commit is contained in:
parent
08f0e548bd
commit
c51731dc69
|
@ -388,7 +388,7 @@
|
||||||
<li> <button ng-click="show(true)" ng-disabled="loading || onlyPending" loading="Updating"> Pending </button>
|
<li> <button ng-click="show(true)" ng-disabled="loading || onlyPending" loading="Updating"> Pending </button>
|
||||||
<li> <button ng-click="show()" ng-disabled="loading || !onlyPending" loading="Updating"> All </button>
|
<li> <button ng-click="show()" ng-disabled="loading || !onlyPending" loading="Updating"> All </button>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="panel radius pending" ng-repeat="tx in txs | orderBy: 'createdTs':true">
|
<div class="panel radius pending" ng-repeat="tx in txs | orderBy: 'createdTs':true | paged:txpCurrentPage:txpItemsPerPage:onlyPending">
|
||||||
<div class="txheader row m10">
|
<div class="txheader row m10">
|
||||||
<div class="large-8 medium-8 small-12 columns">
|
<div class="large-8 medium-8 small-12 columns">
|
||||||
<div class="row" ng-repeat="out in tx.outs">
|
<div class="row" ng-repeat="out in tx.outs">
|
||||||
|
@ -477,6 +477,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<pagination ng-show="!onlyPending" total-items="txs.length" items-per-page="txpItemsPerPage" page="txpCurrentPage" class="pagination-small"></pagination>
|
||||||
</div>
|
</div>
|
||||||
<div class="large-12 columns">
|
<div class="large-12 columns">
|
||||||
<h4>Last transactions</h4>
|
<h4>Last transactions</h4>
|
||||||
|
|
|
@ -8,6 +8,9 @@ angular.module('copay.transactions').controller('TransactionsController',
|
||||||
$scope.onlyPending = true;
|
$scope.onlyPending = true;
|
||||||
$scope.lastShowed = false;
|
$scope.lastShowed = false;
|
||||||
|
|
||||||
|
$scope.txpCurrentPage = 1;
|
||||||
|
$scope.txpItemsPerPage = 4;
|
||||||
|
|
||||||
$scope.update = function () {
|
$scope.update = function () {
|
||||||
$scope.loading = false;
|
$scope.loading = false;
|
||||||
controllerUtils.updateTxs({onlyPending:$scope.onlyPending});
|
controllerUtils.updateTxs({onlyPending:$scope.onlyPending});
|
||||||
|
|
|
@ -19,4 +19,13 @@ angular.module('copay.filters', [])
|
||||||
return { addr: key, value: dic[key] };
|
return { addr: key, value: dic[key] };
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
});
|
})
|
||||||
|
.filter('paged', function() {
|
||||||
|
return function(elements, page, pageSize, disable) {
|
||||||
|
if (disable) return elements;
|
||||||
|
|
||||||
|
var from = (page - 1) * pageSize;
|
||||||
|
var to = from + pageSize;
|
||||||
|
return elements.slice(from, to);;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in New Issue