Fix amount input (angular directive)
This commit is contained in:
parent
871099c9c1
commit
29f4e91423
2 changed files with 3 additions and 4 deletions
|
|
@ -91,15 +91,14 @@ angular.module('copayApp.directives')
|
|||
])
|
||||
.directive('validAmount', ['$rootScope', '$locale',
|
||||
function($rootScope, locale) {
|
||||
var w = $rootScope.wallet;
|
||||
preconditions.checkState(w);
|
||||
preconditions.checkState(w.settings.unitToSatoshi);
|
||||
var formats = locale.NUMBER_FORMATS;
|
||||
|
||||
return {
|
||||
require: 'ngModel',
|
||||
link: function(scope, element, attrs, ctrl) {
|
||||
var val = function(value) {
|
||||
var w = $rootScope.wallet;
|
||||
preconditions.checkState(w);
|
||||
var vNum = Number((value * w.settings.unitToSatoshi).toFixed(0));
|
||||
|
||||
if (typeof value == 'undefined') {
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@
|
|||
<input type="number" id="amount"
|
||||
ng-disabled="loading || ($root.merchant && +$root.merchant.total > 0) || isPayUri"
|
||||
name="amount" placeholder="{{'Amount'|translate}}" ng-model="amount"
|
||||
min="0.00000001" max="10000000000" valid-amount required
|
||||
ng-minlength="0.00000001" ng-maxlength="10000000000" valid-amount required
|
||||
autocomplete="off">
|
||||
<i class="icon-bitcoin"></i>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue