copy address from send and amount screen

This commit is contained in:
Kadir Sekha 2018-01-31 16:10:19 -04:00
commit c600b81137
3 changed files with 4 additions and 3 deletions

View file

@ -1,6 +1,6 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('tabSendController', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, configService) { angular.module('copayApp.controllers').controller('tabSendController', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, configService, bitcoinCashJsService) {
var originalList; var originalList;
var CONTACTS_SHOW_LIMIT; var CONTACTS_SHOW_LIMIT;
@ -199,6 +199,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
$log.debug('Got toAddress:' + addr + ' | ' + item.name); $log.debug('Got toAddress:' + addr + ' | ' + item.name);
return $state.transitionTo('tabs.send.amount', { return $state.transitionTo('tabs.send.amount', {
recipientType: item.recipientType, recipientType: item.recipientType,
displayAddress: item.coin == 'bch' ? bitcoinCashJsService.translateAddresses(addr).cashaddr : addr,
toAddress: addr, toAddress: addr,
toName: item.name, toName: item.name,
toEmail: item.email, toEmail: item.email,

View file

@ -25,7 +25,7 @@
<img src="img/contact-placeholder.svg" class="bg"/> <img src="img/contact-placeholder.svg" class="bg"/>
</i> </i>
</span> </span>
<span class="m10l">{{toName || displayAddress || toAddress}}</span> <span class="m10l" copy-to-clipboard="displayAddress ? ((displayAddress[0] == 'q' || displayAddress[0] == 'p') ? 'bitcoincash:' : '') + displayAddress : toAddress">{{toName || displayAddress || toAddress}}</span>
</div> </div>
</div> </div>

View file

@ -32,7 +32,7 @@
<span class="payment-proposal-to" ng-if="!recipientType"> <span class="payment-proposal-to" ng-if="!recipientType">
<i class="icon icon-svg abs-v-center icon-bitcoinlogoplain"></i> <i class="icon icon-svg abs-v-center icon-bitcoinlogoplain"></i>
<div copy-to-clipboard="tx.displayAddress" ng-if="!tx.paypro" class="ellipsis"> <div copy-to-clipboard="(tx.displayAddress[0] == 'p' || tx.displayAddress[0] == 'q' ? 'bitcoincash:' : '') + tx.displayAddress" ng-if="!tx.paypro" class="ellipsis">
<contact ng-if="tx.displayAddress && !tx.toName" address="{{tx.displayAddress}}"></contact> <contact ng-if="tx.displayAddress && !tx.toName" address="{{tx.displayAddress}}"></contact>
<span class="m15l size-14" ng-if="tx.toName">{{tx.toName}}</span> <span class="m15l size-14" ng-if="tx.toName">{{tx.toName}}</span>
</div> </div>