Merge pull request #3904 from JDonadio/feat/show-more-02

Feat/show more
This commit is contained in:
Gustavo Maximiliano Cortez 2016-02-23 10:47:41 -03:00
commit 94433c23e1
2 changed files with 17 additions and 16 deletions

View file

@ -179,7 +179,7 @@
<div translate>Updating transaction history. Please stand by.</div>
</div>
</div>
</div>
</div>
<div ng-if="index.txHistory[0] && index.updatingTxHistory && index.newTx" class="row collapse last-transactions-content animated fadeInDown">
<div class="large-6 medium-6 small-6 columns size-14">
@ -258,9 +258,10 @@
<div class="m20t text-center">
<a class="text-gray size-12"
ng-show="index.historyShowShowAll"
ng-click="index.showAllHistory()">
<span translate>Show all</span>
ng-show="index.historyShowMore"
ng-click="index.showMore()">
<span translate>Show more</span> ({{index.completeHistory.length - index.txHistory.length}})
<i class="icon-arrow-down4"></i>
</a>
</div>
</div>
@ -358,12 +359,12 @@
<div class="pr p25b">
<h4 class="title m0">
<available-balance></available-balance>
<span
ng-show="home.lockedCurrentFeePerKb || home.blockUx || home.lockAmount"
<span
ng-show="home.lockedCurrentFeePerKb || home.blockUx || home.lockAmount"
class="text-gray" translate>Send All</span>
<a
ng-show="index.availableBalanceSat > 0 && !home.lockedCurrentFeePerKb && !home.blockUx && !home.lockAmount"
ng-click="home.sendAll(index.totalBytesToSendMax, index.availableBalanceSat)"
ng-click="home.sendAll(index.totalBytesToSendMax, index.availableBalanceSat)"
translate> Send All
</a>
<div ng-show="!home.paymentExpired && home._paypro">

View file

@ -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() {