From f2e1a8993c68a4898813f0e92ee11054139b8c5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 24 May 2016 14:10:53 -0300 Subject: [PATCH] adding infinite scroll to the search feature --- public/views/modals/searchTransactions.html | 5 +++++ src/js/controllers/index.js | 9 ++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/public/views/modals/searchTransactions.html b/public/views/modals/searchTransactions.html index f9e2b23a0..7f528b8cf 100644 --- a/public/views/modals/searchTransactions.html +++ b/public/views/modals/searchTransactions.html @@ -64,5 +64,10 @@ + + diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 3d5975b76..f6c8dd754 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -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; };