replace * for x

This commit is contained in:
Javier 2016-07-15 15:36:00 -03:00
commit 8c7c8079ba
5 changed files with 41 additions and 32 deletions

View file

@ -12,8 +12,7 @@
<ul class="no-bullet m0" ng-show="!index.noFocusedWallet">
<!-- <li href ui-sref="preferencesAlias"> -->
<li href ui-sref="send2">
<li href ui-sref="preferencesAlias">
<div class="right text-gray">
{{index.alias||index.walletName}}
<i class="icon-arrow-right3 size-24 right"></i>

View file

@ -17,13 +17,13 @@
<div class="size-21 text-light" ng-show="showAlternative">{{alternativeResult}} {{unitName}}</div>
</div>
<div class="button-content ext-center df">
<button class="button expand button-balanced" ng-click="">Request</button>
<button class="button expand button-balanced" ng-click="">Send</button>
<div class="button-content text-center df">
<button class="button expand button-balanced" ng-click="" translate>Request</button>
<button class="button expand button-balanced" ng-click="" translate>Send</button>
</div>
<div class="button-content ext-center df">
<button class="button expand button-stable" ng-click="pushOperator('*')">*</button>
<div class="button-content text-center size-10 df">
<button class="button expand button-stable" ng-click="pushOperator('x')">x</button>
<button class="button expand button-stable" ng-click="pushOperator('/')">/</button>
<button class="button expand button-stable" ng-click="pushOperator('+')">+</button>
<button class="button expand button-stable" ng-click="pushOperator('-')">-</button>
@ -48,7 +48,7 @@
<div class="button-content text-center df">
<button class="button expand button-light" ng-click="pushDigit('.')">.</button>
<button class="button expand button-light" ng-click="pushDigit('0')">0</button>
<button class="button expand button-light" ng-click="removeDigit()"><</button>
<button class="button expand button-light" ng-click="removeDigit()"><i class="icon ion-backspace-outline"></i></button>
</div>
</div>
</ion-content>
</ion-content>

View file

@ -21,7 +21,7 @@
}
.button-content {
margin-bottom: -20px;
margin-bottom: -15px;
}
.behind {
@ -107,6 +107,20 @@
border: 1px solid #E9E9EC;
}
.button.button-balanced:hover {
background-color: #b2b2b2;
border: 1px solid #E9E9EC;
}
.button.button-balanced:active {
background-color: #ababab;
border: 1px solid #E9E9EC;
}
.button {
text-transform: none;
}
button, .button {
min-width: inherit;
min-height: inherit;

View file

@ -18,13 +18,16 @@ angular.module('copayApp.controllers').controller('send2Controller', function($s
$scope.toggleAlternative = function() {
$scope.showAlternative = !$scope.showAlternative;
var amount;
if ($scope.showAlternative) {
$scope.alternativeAmount = $scope.amountResult;
$scope.alternativeResult = isOperator(lodash.last($scope.amount)) ? evaluate($scope.amount.slice(0, -1)) : evaluate($scope.amount);
amount = processFormat($scope.amount);
$scope.alternativeResult = isOperator(lodash.last(amount)) ? evaluate(amount.slice(0, -1)) : evaluate(amount);
} else {
$scope.amount = $scope.alternativeResult;
$scope.amountResult = isOperator(lodash.last($scope.alternativeAmount)) ? evaluate($scope.alternativeAmount.slice(0, -1)) : evaluate($scope.alternativeAmount);
amount = processFormat($scope.alternativeAmount);
$scope.amountResult = isOperator(lodash.last(amount)) ? evaluate(amount.slice(0, -1)) : evaluate(amount);
}
};
@ -57,16 +60,16 @@ angular.module('copayApp.controllers').controller('send2Controller', function($s
};
function isOperator(val) {
var regex = /[\/\-\+\*]/;
var regex = /[\/\-\+\x\*]/;
var match = regex.exec(val);
if (match) return true;
return false;
};
$scope.removeDigit = function() {
var amount = $scope.showAlternative ? $scope.alternativeAmount.toString() : $scope.amount.toString();
var amount = $scope.showAlternative ? $scope.alternativeAmount : $scope.amount;
if (amount && amount.length == 0) {
if (amount && amount.toString().length == 0) {
resetAmount();
return;
}
@ -101,7 +104,8 @@ angular.module('copayApp.controllers').controller('send2Controller', function($s
}
}
var result = evaluate(val);
var formatedValue = processFormat(val);
var result = evaluate(formatedValue);
if (lodash.isNumber(result)) {
$scope.amount = $scope.alternativeAmount = val;
@ -120,6 +124,10 @@ angular.module('copayApp.controllers').controller('send2Controller', function($s
return result;
};
function processFormat(val) {
return val.toString().replace('x', '*');
};
$scope.close = function() {
go.walletHome();
};

View file

@ -347,30 +347,18 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
},
}
})
.state('send2', {
url: '/send2',
templateUrl: 'views/send2.html',
.state('preferencesAlias', {
url: '/preferencesAlias',
templateUrl: 'views/preferencesAlias.html',
walletShouldBeComplete: true,
needProfile: true,
views: {
'main': {
templateUrl: 'views/send2.html'
templateUrl: 'views/preferencesAlias.html'
},
}
})
// .state('preferencesAlias', {
// url: '/preferencesAlias',
// templateUrl: 'views/preferencesAlias.html',
// walletShouldBeComplete: true,
// needProfile: true,
// views: {
// 'main': {
// templateUrl: 'views/preferencesAlias.html'
// },
//
// }
// })
.state('preferencesEmail', {
url: '/preferencesEmail',
templateUrl: 'views/preferencesEmail.html',