diff options
| author | Adam Soltys <[email protected]> | 2016-02-06 18:13:27 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2016-02-06 18:13:27 -0800 |
| commit | dc762c8715cfc6f75a6deac87fef89a09b954dfa (patch) | |
| tree | ac756a867633304e643f2e13476e3d4c3f0ea8ba /public/js/calculator.js | |
| parent | e971307b7efcdeadd5855580f873c632e1780c4d (diff) | |
| download | coinos-server-dc762c8715cfc6f75a6deac87fef89a09b954dfa.tar.gz coinos-server-dc762c8715cfc6f75a6deac87fef89a09b954dfa.zip | |
Delay QR code generation, blur date select fields to prevent keyboard popup
Diffstat (limited to 'public/js/calculator.js')
| -rw-r--r-- | public/js/calculator.js | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/public/js/calculator.js b/public/js/calculator.js index d8eb7217..fe3ce42c 100644 --- a/public/js/calculator.js +++ b/public/js/calculator.js @@ -128,7 +128,7 @@ }; updateTotal = function() { - var precision, size, subtotal, total; + var precision, size, subtotal, time, total; precision = 9 - multiplier().toString().length; subtotal = parseFloat(g.amount * g.tip).toFixed(2); total = (subtotal * multiplier() / g.exchange).toFixed(precision); @@ -147,14 +147,21 @@ $('.commission').html("+" + (Math.abs(g.user.commission)) + "%"); } $('#total').html(total.toString()); - $('#qr').html(''); size = 300; $('#qr').css('height', size); - return new QRCode('qr', { - text: "bitcoin:" + g.user.address + "?amount=" + (g.amount_requested.toString()), - width: size, - height: size - }); + time = 0; + if (g.timeout) { + time = 1500; + } + clearTimeout(g.timeout); + return g.timeout = setTimeout(function() { + $('#qr').html(''); + return new QRCode('qr', { + text: "bitcoin:" + g.user.address + "?amount=" + (g.amount_requested.toString()), + width: size, + height: size + }); + }, time); }; listen = function() { |
