toggle contact name/address

This commit is contained in:
JDonadio 2017-02-22 15:08:51 -05:00
parent ce15c62ced
commit 9817af964e
3 changed files with 13 additions and 4 deletions

View File

@ -14,6 +14,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
toAmount = data.stateParams.toAmount;
cachedSendMax = {};
$scope.showFeeFiat = false;
$scope.showAddress = false;
$scope.useSendMax = data.stateParams.useSendMax == 'true' ? true : false;
$scope.recipientType = data.stateParams.recipientType || null;
$scope.toAddress = data.stateParams.toAddress;
@ -129,6 +130,10 @@ angular.module('copayApp.controllers').controller('confirmController', function(
$scope.showFeeFiat = !$scope.showFeeFiat;
};
$scope.toggleAddress = function() {
$scope.showAddress = !$scope.showAddress;
};
var initConfirm = function() {
if ($scope.paypro) _paymentTimeControl($scope.paypro.expires);
@ -152,7 +157,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
function resetValues() {
$scope.displayAmount = $scope.displayUnit = $scope.fee = $scope.alternativeAmountStr = $scope.insufficientFunds = $scope.noMatchingWallet = null;
$scope.showFeeFiat = false;
$scope.showFeeFiat = $scope.showAddress = false;
};
$scope.getSendMaxInfo = function() {

View File

@ -17,4 +17,7 @@
.wallet-name {
margin-top: -3px;
}
.toggle {
cursor: pointer;
}
}

View File

@ -55,9 +55,10 @@
<span ng-if="toName" class="wallet-name">{{toName}}</span>
</div>
</div>
<div ng-if="recipientType == 'contact' && !isChromeApp" class="gravatar-contact">
<div ng-if="recipientType == 'contact' && !isChromeApp" class="gravatar-contact toggle" ng-click="toggleAddress()">
<gravatar class="send-gravatar" name="{{toName}}" height="30" width="30" email="{{toEmail}}"></gravatar>
<span ng-if="toName">{{toName}}</span>
<span ng-if="toName && !showAddress">{{toName}}</span>
<span ng-if="toName && showAddress">{{toAddress}}</span>
</div>
</div>
<a class="item item-icon-right" ng-hide="!useSendMax && (insufficientFunds || noMatchingWallet)" ng-click="showWalletSelector()">
@ -83,7 +84,7 @@
</span>
<i class="icon bp-arrow-right"></i>
</a>
<div class="item single-line" ng-if="!insufficientFunds && !noMatchingWallet">
<div class="item single-line toggle" ng-if="!insufficientFunds && !noMatchingWallet">
<span class="label">{{'Fee' | translate}}: {{feeLevel | translate}}</span>
<span ng-if="!showFeeFiat" class="item-note" ng-click="toggleFeeValue()">{{fee || '...'}}</span>
<span ng-if="showFeeFiat" class="item-note" ng-click="toggleFeeValue()">{{feeFiat || '...'}}</span>