From 2de90d093e08fdf5a00ccf34cd5f892d1492dd9a Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Wed, 25 Jun 2014 18:54:08 -0300 Subject: [PATCH] Fixes: * 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 --- css/main.css | 6 ++++++ index.html | 6 +++++- js/controllers/send.js | 10 +++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/css/main.css b/css/main.css index 5c748b33f..2aeac8172 100644 --- a/css/main.css +++ b/css/main.css @@ -635,3 +635,9 @@ ul.pagination li.current a:hover, ul.pagination li.current a:focus { color:white; } +.input-note { + margin-top: -10px; + display: block; + margin-bottom: 1rem; +} + diff --git a/index.html b/index.html index 0ac3f6cfd..8d162de99 100644 --- a/index.html +++ b/index.html @@ -678,7 +678,6 @@
{{$root.unitName}} diff --git a/js/controllers/send.js b/js/controllers/send.js index 26c50f6aa..9d4e96cb3 100644 --- a/js/controllers/send.js +++ b/js/controllers/send.js @@ -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; }; });