diff options
| author | Adam Soltys <[email protected]> | 2012-10-24 16:12:47 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2012-10-24 16:12:47 -0700 |
| commit | ab4107bd5384de79c39e9e290babe377df1ecf2a (patch) | |
| tree | cd679607125f4157ca49059d23c99ba1db8d938a /js | |
| parent | 70fd095f6084802fd48f4cc0c8f605f85a168a46 (diff) | |
| download | coinos-server-ab4107bd5384de79c39e9e290babe377df1ecf2a.tar.gz coinos-server-ab4107bd5384de79c39e9e290babe377df1ecf2a.zip | |
Hide QR when amount is blank
Diffstat (limited to 'js')
| -rw-r--r-- | js/bitcoin_pos.js | 14 |
1 files changed, 8 insertions, 6 deletions
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() { |
