using foundation pagination directive
This commit is contained in:
parent
3fd0dee085
commit
6cefd15cbd
2 changed files with 9 additions and 20 deletions
|
|
@ -14,9 +14,16 @@ angular.module('copayApp.controllers').controller('HistoryController',
|
|||
$scope.currentPage = 1;
|
||||
$scope.itemsPerPage = 10;
|
||||
$scope.nbPages = 0;
|
||||
$scope.totalItems = 0;
|
||||
$scope.blockchain_txs = [];
|
||||
$scope.alternativeCurrency = [];
|
||||
|
||||
|
||||
$scope.selectPage = function(page) {
|
||||
$scope.currentPage = page;
|
||||
$scope.update();
|
||||
};
|
||||
|
||||
$scope.update = function() {
|
||||
$scope.getTransactions();
|
||||
};
|
||||
|
|
@ -28,24 +35,6 @@ angular.module('copayApp.controllers').controller('HistoryController',
|
|||
}, 1);
|
||||
};
|
||||
|
||||
$scope.nextPage = function() {
|
||||
$scope.currentPage++;
|
||||
$scope.update();
|
||||
};
|
||||
|
||||
$scope.previousPage = function() {
|
||||
$scope.currentPage--;
|
||||
$scope.update();
|
||||
};
|
||||
|
||||
$scope.hasNextPage = function() {
|
||||
return $scope.currentPage < $scope.nbPages;
|
||||
};
|
||||
|
||||
$scope.hasPreviousPage = function() {
|
||||
return $scope.currentPage > 1;
|
||||
};
|
||||
|
||||
$scope.getTransactions = function() {
|
||||
var w = $rootScope.wallet;
|
||||
if (!w) return;
|
||||
|
|
@ -72,6 +61,7 @@ angular.module('copayApp.controllers').controller('HistoryController',
|
|||
});
|
||||
$scope.blockchain_txs = w.cached_txs = items;
|
||||
$scope.nbPages = res.nbPages;
|
||||
$scope.totalItems = res.nbItems;
|
||||
|
||||
|
||||
$scope.loading = false;
|
||||
|
|
|
|||
|
|
@ -100,8 +100,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button ng-click="previousPage()" ng-disabled="!hasPreviousPage()">prev</button>
|
||||
<button ng-click="nextPage()" ng-disabled="!hasNextPage()">next</button>
|
||||
<pagination page="currentPage" total-items="totalItems" items-per-page="itemsPerPage" on-select-page="selectPage(page)" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue