diff options
| author | Adam Soltys <[email protected]> | 2016-09-17 19:02:51 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2016-09-17 19:03:20 -0700 |
| commit | 898d21a7cc1fe23a48896618e638b63130ac7c8c (patch) | |
| tree | ca105c92cd9046ee021965e254430bb092511fb0 /public/js/calculator.js | |
| parent | 26bf18266266d8a3957875d0b08ecd457d535410 (diff) | |
| download | coinos-server-898d21a7cc1fe23a48896618e638b63130ac7c8c.tar.gz coinos-server-898d21a7cc1fe23a48896618e638b63130ac7c8c.zip | |
Display and sizing adjustments to handle larger numbers and fit better on small screens (fixes #48)
Diffstat (limited to 'public/js/calculator.js')
| -rw-r--r-- | public/js/calculator.js | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/public/js/calculator.js b/public/js/calculator.js index f54e70bd..4dccce40 100644 --- a/public/js/calculator.js +++ b/public/js/calculator.js @@ -44,7 +44,7 @@ updateTotal(); return; } - if (n > 1000) { + if (n > 100000) { return; } if (m === '00') { @@ -61,12 +61,16 @@ return updateTotal(); }); $('.tippad .btn').off('click').click(function(e) { - var value; + var text, value; e.preventDefault(); + text = $(this).html(); + if (text === 'No Tip') { + value = 0; + } else { + value = text.slice(1, -1); + } $(this).addClass('active'); - value = $(this).html().slice(0, -1); - $(this).siblings().css('font-weight', 'normal').removeClass('active'); - $(this).css('font-weight', 'bold'); + $(this).siblings().removeClass('active'); g.tip = 1 + (parseFloat(value) / 100); return updateTotal(); }); @@ -151,7 +155,7 @@ $('#qr').css('height', size); time = 0; if (g.timeout) { - time = 1500; + time = 10; } clearTimeout(g.timeout); return g.timeout = setTimeout(function() { |
