From 6cefd15cbdd2d66ba3209e73925a20534607ae32 Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Mon, 10 Nov 2014 19:10:24 -0300 Subject: [PATCH] using foundation pagination directive --- js/controllers/history.js | 26 ++++++++------------------ views/history.html | 3 +-- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/js/controllers/history.js b/js/controllers/history.js index ff8f41ebc..391dfd51c 100644 --- a/js/controllers/history.js +++ b/js/controllers/history.js @@ -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; diff --git a/views/history.html b/views/history.html index deac8c694..b8805bad5 100644 --- a/views/history.html +++ b/views/history.html @@ -100,8 +100,7 @@ - - +