Send view contents
This commit is contained in:
parent
5955041547
commit
db8d587101
4 changed files with 46 additions and 26 deletions
|
|
@ -4,45 +4,47 @@
|
||||||
</ion-nav-bar>
|
</ion-nav-bar>
|
||||||
|
|
||||||
<ion-content>
|
<ion-content>
|
||||||
<div>
|
<div class="item item-heading" translate>Recipient</div>
|
||||||
<div class="item item-heading" translate>Recipient</div>
|
<label class="item item-input bitcoin-address">
|
||||||
<label class="item item-input bitcoin-address">
|
<i class="icon ion-social-bitcoin placeholder-icon"></i>
|
||||||
<i class="icon ion-search placeholder-icon"></i>
|
<div class="qr-scan-icon" ng-style="{'width': '100%'}">
|
||||||
<div class="qr-scan-icon" ng-style="{'width': '100%'}">
|
<qr-scanner class="qr-icon size-24" ng-style="{'top': '3px'}" on-scan="onQrCodeScanned(data)"></qr-scanner>
|
||||||
<qr-scanner class="qr-icon size-24" ng-style="{'top': '3px'}" on-scan="onQrCodeScanned(data)"></qr-scanner>
|
<input type="text"
|
||||||
<input type="text"
|
placeholder="{{'Search or enter bitcoin address' | translate}}"
|
||||||
placeholder="Search or enter bitcoin address"
|
ng-model="formData.search"
|
||||||
ng-model="formData.search"
|
ng-change="findContact(formData.search)"
|
||||||
ng-change="findContact(formData.search)"
|
ng-model-onblur>
|
||||||
ng-model-onblur>
|
</div>
|
||||||
</div>
|
</label>
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="item item-icon-right item-heading">
|
<div class="item item-icon-right item-heading">
|
||||||
<span translate>Contacts</span>
|
<span translate>Contacts</span>
|
||||||
<a ui-sref="tabs.send.addressbook"><i class="icon ion-ios-plus-empty list-add-button"></i></a>
|
<a ng-show="hasContacts" ui-sref="tabs.send.addressbook"><i class="icon ion-ios-plus-empty list-add-button"></i></a>
|
||||||
</div>
|
</div>
|
||||||
<a class="item item-icon-left ng-hide" ng-show="!hasContacts" ui-sref="tabs.send.addressbook">
|
<a class="item item-icon-left item-icon-right ng-hide" ng-show="!hasContacts" ui-sref="tabs.send.addressbook">
|
||||||
<gravatar class="send-gravatar" name="" width="30" email=""></gravatar>
|
<gravatar class="send-gravatar" name="" width="30" email=""></gravatar>
|
||||||
<span translate>Add a Contact</span>
|
<span translate>Add a Contact</span>
|
||||||
|
<i class="icon nav-item-arrow-right"></i>
|
||||||
</a>
|
</a>
|
||||||
<a class="item item-icon-left ng-hide" ng-repeat="item in list" ng-show="hasContacts && !item.isWallet" ng-click="goToAmount(item)">
|
<a class="item item-icon-left item-icon-right ng-hide" ng-repeat="item in list" ng-show="hasContacts && !item.isWallet" ng-click="goToAmount(item)">
|
||||||
<gravatar class="send-gravatar" name="{{item.name}}" width="30" email="{{item.email}}"></gravatar>
|
<gravatar class="send-gravatar" name="{{item.name}}" width="30" email="{{item.email}}"></gravatar>
|
||||||
{{item.name}}
|
{{item.name}}
|
||||||
|
<i class="icon nav-item-arrow-right"></i>
|
||||||
</a>
|
</a>
|
||||||
|
<div class="show-more" ng-show="contactsShowMore" ng-click="showMore()" translate>
|
||||||
|
Show more
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card">
|
<div class="card" ng-show="hasWallets && !oneWallet">
|
||||||
<div class="item item-heading">
|
<div class="item item-heading">
|
||||||
<span translate>Transfer to Wallet</span>
|
<span translate>Transfer to Wallet</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="item text-center ng-hide" ng-show="!hasWallets" translate>No Wallet</div>
|
<a class="item item-icon-left item-icon-right ng-hide" ng-repeat="item in list" ng-show="hasWallets && item.isWallet" ng-click="goToAmount(item)">
|
||||||
<a class="item item-icon-left ng-hide" ng-repeat="item in list" ng-show="hasWallets && item.isWallet" ng-click="goToAmount(item)">
|
|
||||||
<i ng-show="item.isWallet" class="icon ion-briefcase size-21" ng-style="{'color':item.color}"></i>
|
<i ng-show="item.isWallet" class="icon ion-briefcase size-21" ng-style="{'color':item.color}"></i>
|
||||||
<gravatar class="send-gravatar" ng-show="!item.isWallet" name="{{item.name}}" width="30" email="{{item.email}}"></gravatar>
|
|
||||||
{{item.name}}
|
{{item.name}}
|
||||||
|
<i class="icon nav-item-arrow-right"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
'use strict';
|
'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 originalList;
|
||||||
|
var CONTACTS_SHOW_LIMIT = 10;
|
||||||
|
var currentContactsPage = 0;
|
||||||
|
|
||||||
var updateList = function() {
|
var updateList = function() {
|
||||||
originalList = [];
|
originalList = [];
|
||||||
|
|
@ -11,6 +13,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
||||||
onlyComplete: true
|
onlyComplete: true
|
||||||
});
|
});
|
||||||
$scope.hasWallets = lodash.isEmpty(wallets) ? false : true;
|
$scope.hasWallets = lodash.isEmpty(wallets) ? false : true;
|
||||||
|
$scope.oneWallet = wallets.length == 1;
|
||||||
|
|
||||||
lodash.each(wallets, function(v) {
|
lodash.each(wallets, function(v) {
|
||||||
originalList.push({
|
originalList.push({
|
||||||
|
|
@ -27,9 +30,9 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
||||||
if (err) $log.error(err);
|
if (err) $log.error(err);
|
||||||
|
|
||||||
$scope.hasContacts = lodash.isEmpty(ab) ? false : true;
|
$scope.hasContacts = lodash.isEmpty(ab) ? false : true;
|
||||||
var contacts = [];
|
var completeContacts = [];
|
||||||
lodash.each(ab, function(v, k) {
|
lodash.each(ab, function(v, k) {
|
||||||
contacts.push({
|
completeContacts.push({
|
||||||
name: lodash.isObject(v) ? v.name : v,
|
name: lodash.isObject(v) ? v.name : v,
|
||||||
address: k,
|
address: k,
|
||||||
email: lodash.isObject(v) ? v.email : null,
|
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);
|
originalList = originalList.concat(contacts);
|
||||||
$scope.list = lodash.clone(originalList);
|
$scope.list = lodash.clone(originalList);
|
||||||
|
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
|
$ionicScrollDelegate.resize();
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
}, 1);
|
}, 10);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.showMore = function() {
|
||||||
|
currentContactsPage++;
|
||||||
|
updateList();
|
||||||
|
};
|
||||||
|
|
||||||
$scope.findContact = function(search) {
|
$scope.findContact = function(search) {
|
||||||
|
|
||||||
if (incomingData.redir(search)) {
|
if (incomingData.redir(search)) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
angular.module('copayApp.services')
|
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;
|
var isChromeApp = platformInfo.isChromeApp;
|
||||||
|
|
|
||||||
|
|
@ -16,4 +16,11 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 10px;
|
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