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.coffee | |
| 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.coffee')
| -rw-r--r-- | public/js/calculator.coffee | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/public/js/calculator.coffee b/public/js/calculator.coffee index 69b24642..e6cc813e 100644 --- a/public/js/calculator.coffee +++ b/public/js/calculator.coffee @@ -142,16 +142,24 @@ updateTotal = -> $('#total').html(total.toString()) - $('#qr').html('') # size = $('#calculator').width() * 0.7 size = 300 $('#qr').css('height', size) - 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) + g.timeout = setTimeout(-> + $('#qr').html('') + new QRCode('qr', + text: "bitcoin:#{g.user.address}?amount=#{g.amount_requested.toString()}" + width: size + height: size + ) + , time) listen = -> g.attempts++ |
