* Copy available funds to input (amount) on Chrome browser.
* Improve style of topAvailable button.
* Show valid message immediately after copy.
* Hide link if not have funds
This commit is contained in:
Gustavo Cortez 2014-06-25 18:54:08 -03:00
commit 2de90d093e
3 changed files with 18 additions and 4 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;
};
});