Send view contents
This commit is contained in:
parent
5955041547
commit
db8d587101
4 changed files with 46 additions and 26 deletions
|
|
@ -1,8 +1,10 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('tabSendController', function($scope, $log, $timeout, addressbookService, profileService, lodash, $state, walletService, incomingData) {
|
||||
angular.module('copayApp.controllers').controller('tabSendController', function($scope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData) {
|
||||
|
||||
var originalList;
|
||||
var CONTACTS_SHOW_LIMIT = 10;
|
||||
var currentContactsPage = 0;
|
||||
|
||||
var updateList = function() {
|
||||
originalList = [];
|
||||
|
|
@ -11,6 +13,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
|||
onlyComplete: true
|
||||
});
|
||||
$scope.hasWallets = lodash.isEmpty(wallets) ? false : true;
|
||||
$scope.oneWallet = wallets.length == 1;
|
||||
|
||||
lodash.each(wallets, function(v) {
|
||||
originalList.push({
|
||||
|
|
@ -27,9 +30,9 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
|||
if (err) $log.error(err);
|
||||
|
||||
$scope.hasContacts = lodash.isEmpty(ab) ? false : true;
|
||||
var contacts = [];
|
||||
var completeContacts = [];
|
||||
lodash.each(ab, function(v, k) {
|
||||
contacts.push({
|
||||
completeContacts.push({
|
||||
name: lodash.isObject(v) ? v.name : v,
|
||||
address: k,
|
||||
email: lodash.isObject(v) ? v.email : null,
|
||||
|
|
@ -39,15 +42,23 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
|||
});
|
||||
});
|
||||
|
||||
var contacts = completeContacts.slice(0, (currentContactsPage + 1) * CONTACTS_SHOW_LIMIT);
|
||||
$scope.contactsShowMore = completeContacts.length > contacts.length;
|
||||
originalList = originalList.concat(contacts);
|
||||
$scope.list = lodash.clone(originalList);
|
||||
|
||||
$timeout(function() {
|
||||
$ionicScrollDelegate.resize();
|
||||
$scope.$apply();
|
||||
}, 1);
|
||||
}, 10);
|
||||
});
|
||||
};
|
||||
|
||||
$scope.showMore = function() {
|
||||
currentContactsPage++;
|
||||
updateList();
|
||||
};
|
||||
|
||||
$scope.findContact = function(search) {
|
||||
|
||||
if (incomingData.redir(search)) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
angular.module('copayApp.services')
|
||||
.factory('profileService', function profileServiceFactory($rootScope, $timeout, $filter, $log, sjcl, lodash, storageService, bwcService, configService, pushNotificationsService, gettext, gettextCatalog, bwcError, uxLanguage, platformInfo, $ionicHistory, txFormatService, $state) {
|
||||
.factory('profileService', function profileServiceFactory($rootScope, $timeout, $filter, $log, sjcl, lodash, storageService, bwcService, configService, pushNotificationsService, gettext, gettextCatalog, bwcError, uxLanguage, platformInfo, txFormatService, $state) {
|
||||
|
||||
|
||||
var isChromeApp = platformInfo.isChromeApp;
|
||||
|
|
|
|||
|
|
@ -16,4 +16,11 @@
|
|||
position: absolute;
|
||||
top: 10px;
|
||||
}
|
||||
.show-more {
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
font-size: 16px;
|
||||
color: #387ef5;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue