From 208311023aa6eb433d5e1201eafcd53fab0e6dbd Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 10 Dec 2015 18:22:00 -0800 Subject: Form validation with bootstrap-validator --- public/js/wallet.js | 61 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 18 deletions(-) (limited to 'public/js/wallet.js') diff --git a/public/js/wallet.js b/public/js/wallet.js index 6d880b82..d83b764d 100644 --- a/public/js/wallet.js +++ b/public/js/wallet.js @@ -1,6 +1,6 @@ ;(function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0](function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s 0); + $('#manage').hide(); return $('#privkey').val(g.user.privkey); }); $('#withdraw').click(function() { @@ -189,8 +209,13 @@ $('#balance').html(g.balance); $('#fiat').html("" + fiat + " " + g.user.currency); $('#amount').attr('max', g.balance); - $('#amount').focus(); - return $('.wallet').fadeIn(); + $('.wallet').fadeIn(); + if (g.balance > 0) { + $('#withdrawal').show(); + return $('#amount').focus(); + } else { + return $('#manage').click(); + } }); }; -- cgit v1.2.3