update slide text button

This commit is contained in:
JDonadio 2017-01-16 16:25:12 -03:00
commit 96c1c1a293
5 changed files with 65 additions and 35 deletions

View file

@ -53,8 +53,30 @@ angular.module('copayApp.controllers').controller('confirmController', function(
else $scope.network = (new bitcore.Address($scope.toAddress)).network.name;
resetValues();
setwallets();
applyButtonText();
});
function applyButtonText(multisig) {
$scope.buttonText = $scope.isCordova ? gettextCatalog.getString('Slide') + ' ' : gettextCatalog.getString('Click') + ' ';
if ($scope.paypro) {
$scope.buttonText += gettextCatalog.getString('to pay');
return;
}
if ($scope.isGlidera || $scope.isGiftCard || $scope.cardId) {
$scope.buttonText += gettextCatalog.getString('to complete');
return;
}
if (multisig) {
$scope.buttonText += gettextCatalog.getString('to accept');
return;
}
$scope.buttonText += gettextCatalog.getString('to send');
};
function setwallets() {
$scope.wallets = profileService.getWallets({
onlyComplete: true,
@ -268,6 +290,8 @@ angular.module('copayApp.controllers').controller('confirmController', function(
$scope.getSendMaxInfo();
} else
setWallet(wallet);
applyButtonText(wallet.credentials.n > 1);
};
$scope.showDescriptionPopup = function() {

View file

@ -19,15 +19,37 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
$scope.displayUnit = getDisplayUnit($scope.tx.amountStr);
initActionList();
checkPaypro();
}
applyButtonText();
};
function applyButtonText(multisig) {
$scope.buttonText = $scope.isCordova ? gettextCatalog.getString('Slide') + ' ' : gettextCatalog.getString('Click') + ' ';
if ($scope.paypro) {
$scope.buttonText += gettextCatalog.getString('to pay');
return;
}
if ($scope.isGlidera || $scope.isGiftCard || $scope.cardId) {
$scope.buttonText += gettextCatalog.getString('to complete');
return;
}
if (multisig) {
$scope.buttonText += gettextCatalog.getString('to accept');
return;
}
$scope.buttonText += gettextCatalog.getString('to send');
};
function getDisplayAmount(amountStr) {
return amountStr.split(' ')[0];
}
};
function getDisplayUnit(amountStr) {
return amountStr.split(' ')[1];
}
};
function initActionList() {
$scope.actionList = [];

View file

@ -131,17 +131,16 @@
has-wallet-chosen="wallet"
insufficient-funds="insufficientFunds"
no-matching-wallet="noMatchingWallet">
{{'Accept' | translate}}
{{buttonText}}
</click-to-accept>
<slide-to-accept
ng-disabled="!wallet"
ng-if="isCordova"
ng-if="isCordova && (wallet && !insufficientFunds && !noMatchingWallet)"
slide-on-confirm="onConfirm()"
slide-send-status="sendStatus"
has-wallet-chosen="wallet"
insufficient-funds="insufficientFunds"
no-matching-wallet="noMatchingWallet">
{{'Accept' | translate}}
{{buttonText}}
</slide-to-accept>
<slide-to-accept-success
slide-success-show="sendStatus === 'success'"

View file

@ -1,34 +1,20 @@
<div class="slide__listener"
ng-touchstart="onTouchstart($event);"
ng-touchmove="onTouchmove($event);"
ng-touchend="onTouchend($event);"
ng-mousedown="onTouchstart($event);"
ng-mousemove="onTouchmove($event);"
ng-mouseup="onTouchend($event);"
>
<div
class="slide__slider"
ng-style="sliderStyle"
>
ng-touchstart="onTouchstart($event)"
ng-touchmove="onTouchmove($event)"
ng-touchend="onTouchend($event)"
ng-mousedown="onTouchstart($event)"
ng-mousemove="onTouchmove($event)"
ng-mouseup="onTouchend($event)">
<div class="slide__slider" ng-style="sliderStyle">
<div class="slide__slider__tip"></div>
</div>
<div
class="slide__bitcoin"
ng-style="bitcoinStyle"
>
<div class="slide__bitcoin" ng-style="bitcoinStyle">
<img src="img/icon-bitcoin-white.svg">
</div>
<div
class="slide__button-text"
ng-style="textStyle"
>
<div class="slide__button-text" ng-style="textStyle">
<ng-transclude></ng-transclude>
</div>
<div
class="slide__status-text"
ng-class="{enter: isSlidFully}"
ng-hide="sendStatus === 'success'"
>
<div class="slide__status-text" ng-class="{enter: isSlidFully}" ng-hide="sendStatus === 'success'">
<img src="img/spinner.png">
{{displaySendStatus}}
</div>

View file

@ -166,19 +166,18 @@
ng-if="tx.pendingForUs && canSign && !paymentExpired && hasClick"
click-send-status="sendStatus"
has-wallet-chosen="true">
{{'Accept'| translate}}
{{buttonText}}
</click-to-accept>
<slide-to-accept
ng-if="tx.pendingForUs && canSign && !paymentExpired && !hasClick"
slide-on-confirm="onConfirm()"
slide-send-status="sendStatus"
has-wallet-chosen="true">
{{'Accept'| translate}}
{{buttonText}}
</slide-to-accept>
<slide-to-accept-success
slide-success-show="sendStatus === 'success'"
slide-success-on-confirm="onSuccessConfirm()"
>
slide-success-on-confirm="onSuccessConfirm()">
{{'Payment Sent' | translate}}
</slide-to-accept-success>
</ion-modal-view>