From 147de5e6971b6c1e21316fd5942a47a2d63c2f4b Mon Sep 17 00:00:00 2001 From: Javier Date: Mon, 22 Feb 2016 17:33:41 -0300 Subject: [PATCH 1/2] show more --- public/views/walletHome.html | 15 ++++++++------- src/js/controllers/index.js | 18 +++++++++--------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index 7dd1ed9d6..c0c5ea510 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -179,7 +179,7 @@
Updating transaction history. Please stand by.
- +
@@ -358,12 +359,12 @@

- Send All Send All
diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index ba3bbd100..875c1b8f2 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -14,6 +14,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r ret.usePushNotifications = ret.isCordova && !isMobile.Windows(); ret.onGoingProcess = {}; ret.historyShowLimit = 10; + ret.historyShowMoreLimit = 100; ret.prevState = 'walletHome'; ret.menu = [{ @@ -892,15 +893,13 @@ angular.module('copayApp.controllers').controller('indexController', function($r }); } - self.showAllHistory = function() { - self.historyShowShowAll = false; - self.historyRendering = true; + self.showMore = function() { $timeout(function() { - $rootScope.$apply(); - $timeout(function() { - self.historyRendering = false; - self.txHistory = self.completeHistory; - }, 100); + self.txHistory = self.completeHistory.slice(0, self.nextTxHistory); + $log.debug('Total txs: ', self.txHistory.length + '/' + self.completeHistory.length); + self.nextTxHistory += self.historyShowMoreLimit; + if (self.txHistory.length >= self.completeHistory.length) + self.historyShowMore = false; }, 100); }; @@ -956,8 +955,9 @@ angular.module('copayApp.controllers').controller('indexController', function($r }; self.setCompactTxHistory = function() { + self.nextTxHistory = self.historyShowMoreLimit; self.txHistory = self.completeHistory.slice(0, self.historyShowLimit); - self.historyShowShowAll = self.completeHistory.length > self.historyShowLimit; + self.historyShowMore = self.completeHistory.length > self.historyShowLimit; }; self.debounceUpdateHistory = lodash.debounce(function() { From e6dd97adbb31ff71cb6dedc9e57cd63b6b5043ea Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 23 Feb 2016 10:43:58 -0300 Subject: [PATCH 2/2] fix wording --- public/views/walletHome.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index c0c5ea510..dd46d60be 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -260,7 +260,7 @@ - {{index.completeHistory.length - index.txHistory.length}} more + Show more ({{index.completeHistory.length - index.txHistory.length}})