aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--css/bitcoin_pos.css1
-rw-r--r--js/bitcoin_pos.js14
2 files changed, 9 insertions, 6 deletions
diff --git a/css/bitcoin_pos.css b/css/bitcoin_pos.css
index f6b80f58..4eb97575 100644
--- a/css/bitcoin_pos.css
+++ b/css/bitcoin_pos.css
@@ -6,6 +6,7 @@ span.btn { font-size: 1.4em; width: 80%; }
small, label { color: #999; font-size: 1.2em; }
strong#total { font-size: 2em; }
img#banner { width: 100%; }
+div#payment { display: none; }
div.container-fluid {
margin-left: auto;
diff --git a/js/bitcoin_pos.js b/js/bitcoin_pos.js
index f05407d3..396a371e 100644
--- a/js/bitcoin_pos.js
+++ b/js/bitcoin_pos.js
@@ -22,20 +22,22 @@ $(function() {
$('#amount').keyup(updateTotal);
$('#amount').focus();
$('#amount').focus(function() {
- $('#payment').show();
$('#received').hide();
- $('#total').html('0');
$(this).val('');
+ updateTotal();
});
function updateTotal() {
var amount = parseFloat($('#amount').val());
var total = amount / exchange;
total = Math.ceil(total * 10000) / 10000;
- if (!$.isNumeric(total)) total = '';
- $('#total').html(total.toString());
-
- displayQR('bitcoin:' + address + '?amount=' + total.toString());
+ if (!$.isNumeric(total) || total == 0) {
+ $('#payment').fadeOut('slow');
+ } else {
+ $('#payment').fadeIn('slow');
+ $('#total').html(total.toString());
+ displayQR('bitcoin:' + address + '?amount=' + total.toString());
+ }
}
function setupSocket() {