mirror of https://github.com/BTCPrivate/copay.git
adding infinite scroll to the search feature
This commit is contained in:
parent
5413e87f09
commit
f2e1a8993c
|
@ -64,5 +64,10 @@
|
|||
<i class="icon-arrow-right3 size-18"></i>
|
||||
</div>
|
||||
</div>
|
||||
<ion-infinite-scroll
|
||||
ng-if="index.historyShowMore"
|
||||
on-infinite="index.showMore()"
|
||||
distance="1%">
|
||||
</ion-infinite-scroll>
|
||||
</ion-content>
|
||||
</ion-modal-view>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('indexController', function($rootScope, $scope, $log, $filter, $timeout, latestReleaseService, bwcService, pushNotificationsService, lodash, go, profileService, configService, rateService, storageService, addressService, gettext, gettextCatalog, amMoment, addonManager, bwsError, txFormatService, uxLanguage, glideraService, coinbaseService, platformInfo, addressbookService, walletService) {
|
||||
angular.module('copayApp.controllers').controller('indexController', function($rootScope, $scope, $log, $filter, $timeout, $ionicScrollDelegate, latestReleaseService, bwcService, pushNotificationsService, lodash, go, profileService, configService, rateService, storageService, addressService, gettext, gettextCatalog, amMoment, addonManager, bwsError, txFormatService, uxLanguage, glideraService, coinbaseService, platformInfo, addressbookService, walletService) {
|
||||
var self = this;
|
||||
var SOFT_CONFIRMATION_LIMIT = 12;
|
||||
var errors = bwcService.getErrors();
|
||||
|
@ -967,9 +967,8 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
self.historyShowMore = false;
|
||||
} else {
|
||||
self.txHistory = self.completeHistory.slice(0, self.nextTxHistory);
|
||||
self.txHistorySearchResults = self.txHistory;
|
||||
$log.debug('Total txs: ', self.txHistorySearchResults.length + '/' + self.completeHistory.length);
|
||||
if (self.txHistorySearchResults.length >= self.completeHistory.length)
|
||||
$log.debug('Total txs: ', self.txHistory.length + '/' + self.completeHistory.length);
|
||||
if (self.txHistory.length >= self.completeHistory.length)
|
||||
self.historyShowMore = false;
|
||||
}
|
||||
self.nextTxHistory += self.historyShowMoreLimit;
|
||||
|
@ -996,6 +995,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
if (isCordova)
|
||||
window.plugins.toast.hide();
|
||||
self.throttleSearch();
|
||||
$ionicScrollDelegate.resize();
|
||||
}
|
||||
|
||||
self.throttleSearch = lodash.throttle(function() {
|
||||
|
@ -1098,7 +1098,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
self.isSearching = false;
|
||||
self.nextTxHistory = self.historyShowMoreLimit;
|
||||
self.txHistory = self.completeHistory ? self.completeHistory.slice(0, self.historyShowLimit) : null;
|
||||
self.txHistorySearchResults = self.txHistory;
|
||||
self.historyShowMore = self.completeHistory ? self.completeHistory.length > self.historyShowLimit : null;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue