replace * for x
This commit is contained in:
parent
65766c6fe5
commit
8c7c8079ba
5 changed files with 41 additions and 32 deletions
|
|
@ -12,8 +12,7 @@
|
||||||
|
|
||||||
<ul class="no-bullet m0" ng-show="!index.noFocusedWallet">
|
<ul class="no-bullet m0" ng-show="!index.noFocusedWallet">
|
||||||
|
|
||||||
<!-- <li href ui-sref="preferencesAlias"> -->
|
<li href ui-sref="preferencesAlias">
|
||||||
<li href ui-sref="send2">
|
|
||||||
<div class="right text-gray">
|
<div class="right text-gray">
|
||||||
{{index.alias||index.walletName}}
|
{{index.alias||index.walletName}}
|
||||||
<i class="icon-arrow-right3 size-24 right"></i>
|
<i class="icon-arrow-right3 size-24 right"></i>
|
||||||
|
|
|
||||||
|
|
@ -17,13 +17,13 @@
|
||||||
<div class="size-21 text-light" ng-show="showAlternative">{{alternativeResult}} {{unitName}}</div>
|
<div class="size-21 text-light" ng-show="showAlternative">{{alternativeResult}} {{unitName}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="button-content ext-center df">
|
<div class="button-content text-center df">
|
||||||
<button class="button expand button-balanced" ng-click="">Request</button>
|
<button class="button expand button-balanced" ng-click="" translate>Request</button>
|
||||||
<button class="button expand button-balanced" ng-click="">Send</button>
|
<button class="button expand button-balanced" ng-click="" translate>Send</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="button-content ext-center df">
|
<div class="button-content text-center size-10 df">
|
||||||
<button class="button expand button-stable" ng-click="pushOperator('*')">*</button>
|
<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>
|
<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">
|
<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('.')">.</button>
|
||||||
<button class="button expand button-light" ng-click="pushDigit('0')">0</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>
|
||||||
</div>
|
</div>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-content {
|
.button-content {
|
||||||
margin-bottom: -20px;
|
margin-bottom: -15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.behind {
|
.behind {
|
||||||
|
|
@ -107,6 +107,20 @@
|
||||||
border: 1px solid #E9E9EC;
|
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 {
|
button, .button {
|
||||||
min-width: inherit;
|
min-width: inherit;
|
||||||
min-height: inherit;
|
min-height: inherit;
|
||||||
|
|
|
||||||
|
|
@ -18,13 +18,16 @@ angular.module('copayApp.controllers').controller('send2Controller', function($s
|
||||||
|
|
||||||
$scope.toggleAlternative = function() {
|
$scope.toggleAlternative = function() {
|
||||||
$scope.showAlternative = !$scope.showAlternative;
|
$scope.showAlternative = !$scope.showAlternative;
|
||||||
|
var amount;
|
||||||
|
|
||||||
if ($scope.showAlternative) {
|
if ($scope.showAlternative) {
|
||||||
$scope.alternativeAmount = $scope.amountResult;
|
$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 {
|
} else {
|
||||||
$scope.amount = $scope.alternativeResult;
|
$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) {
|
function isOperator(val) {
|
||||||
var regex = /[\/\-\+\*]/;
|
var regex = /[\/\-\+\x\*]/;
|
||||||
var match = regex.exec(val);
|
var match = regex.exec(val);
|
||||||
if (match) return true;
|
if (match) return true;
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.removeDigit = function() {
|
$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();
|
resetAmount();
|
||||||
return;
|
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)) {
|
if (lodash.isNumber(result)) {
|
||||||
$scope.amount = $scope.alternativeAmount = val;
|
$scope.amount = $scope.alternativeAmount = val;
|
||||||
|
|
@ -120,6 +124,10 @@ angular.module('copayApp.controllers').controller('send2Controller', function($s
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function processFormat(val) {
|
||||||
|
return val.toString().replace('x', '*');
|
||||||
|
};
|
||||||
|
|
||||||
$scope.close = function() {
|
$scope.close = function() {
|
||||||
go.walletHome();
|
go.walletHome();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -347,30 +347,18 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.state('send2', {
|
.state('preferencesAlias', {
|
||||||
url: '/send2',
|
url: '/preferencesAlias',
|
||||||
templateUrl: 'views/send2.html',
|
templateUrl: 'views/preferencesAlias.html',
|
||||||
walletShouldBeComplete: true,
|
walletShouldBeComplete: true,
|
||||||
needProfile: true,
|
needProfile: true,
|
||||||
views: {
|
views: {
|
||||||
'main': {
|
'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', {
|
.state('preferencesEmail', {
|
||||||
url: '/preferencesEmail',
|
url: '/preferencesEmail',
|
||||||
templateUrl: 'views/preferencesEmail.html',
|
templateUrl: 'views/preferencesEmail.html',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue