Merge pull request #759 from cmgustavo/bug/01-amount-input

Bug/01 amount input
This commit is contained in:
Matias Alejo Garcia 2014-06-26 22:47:56 -03:00
commit 4467ae270f
7 changed files with 136 additions and 44 deletions

View file

@ -267,8 +267,12 @@ angular.module('copayApp.controllers').controller('SendController',
});
};
$scope.topAmount = function() {
var maxSat = ($rootScope.availableBalance * config.unitToSatoshi).toFixed(0) - bitcore.TransactionBuilder.FEE_PER_1000B_SAT;
$scope.amount = maxSat / config.unitToSatoshi;
$scope.getAvailableAmount = function() {
return ((($rootScope.availableBalance * config.unitToSatoshi).toFixed(0) - bitcore.TransactionBuilder.FEE_PER_1000B_SAT) / config.unitToSatoshi);
};
$scope.topAmount = function(form) {
$scope.amount = $scope.getAvailableAmount();
form.amount.$pristine = false;
};
});