adding infinite scroll to the search feature
This commit is contained in:
parent
5413e87f09
commit
f2e1a8993c
2 changed files with 9 additions and 5 deletions
|
|
@ -64,5 +64,10 @@
|
||||||
<i class="icon-arrow-right3 size-18"></i>
|
<i class="icon-arrow-right3 size-18"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<ion-infinite-scroll
|
||||||
|
ng-if="index.historyShowMore"
|
||||||
|
on-infinite="index.showMore()"
|
||||||
|
distance="1%">
|
||||||
|
</ion-infinite-scroll>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
</ion-modal-view>
|
</ion-modal-view>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'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 self = this;
|
||||||
var SOFT_CONFIRMATION_LIMIT = 12;
|
var SOFT_CONFIRMATION_LIMIT = 12;
|
||||||
var errors = bwcService.getErrors();
|
var errors = bwcService.getErrors();
|
||||||
|
|
@ -967,9 +967,8 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
self.historyShowMore = false;
|
self.historyShowMore = false;
|
||||||
} else {
|
} else {
|
||||||
self.txHistory = self.completeHistory.slice(0, self.nextTxHistory);
|
self.txHistory = self.completeHistory.slice(0, self.nextTxHistory);
|
||||||
self.txHistorySearchResults = self.txHistory;
|
$log.debug('Total txs: ', self.txHistory.length + '/' + self.completeHistory.length);
|
||||||
$log.debug('Total txs: ', self.txHistorySearchResults.length + '/' + self.completeHistory.length);
|
if (self.txHistory.length >= self.completeHistory.length)
|
||||||
if (self.txHistorySearchResults.length >= self.completeHistory.length)
|
|
||||||
self.historyShowMore = false;
|
self.historyShowMore = false;
|
||||||
}
|
}
|
||||||
self.nextTxHistory += self.historyShowMoreLimit;
|
self.nextTxHistory += self.historyShowMoreLimit;
|
||||||
|
|
@ -996,6 +995,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
if (isCordova)
|
if (isCordova)
|
||||||
window.plugins.toast.hide();
|
window.plugins.toast.hide();
|
||||||
self.throttleSearch();
|
self.throttleSearch();
|
||||||
|
$ionicScrollDelegate.resize();
|
||||||
}
|
}
|
||||||
|
|
||||||
self.throttleSearch = lodash.throttle(function() {
|
self.throttleSearch = lodash.throttle(function() {
|
||||||
|
|
@ -1098,7 +1098,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
self.isSearching = false;
|
self.isSearching = false;
|
||||||
self.nextTxHistory = self.historyShowMoreLimit;
|
self.nextTxHistory = self.historyShowMoreLimit;
|
||||||
self.txHistory = self.completeHistory ? self.completeHistory.slice(0, self.historyShowLimit) : null;
|
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;
|
self.historyShowMore = self.completeHistory ? self.completeHistory.length > self.historyShowLimit : null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue