diff options
| author | Adam Soltys <[email protected]> | 2016-09-09 23:11:48 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2016-09-09 23:11:48 -0700 |
| commit | 26bf18266266d8a3957875d0b08ecd457d535410 (patch) | |
| tree | 77f3639903b918bfeb4549060745ad9614929cfc /public/js/setup.js | |
| parent | 15323547a93a5c8fdfcbf0154c213985f3d8c3af (diff) | |
| download | coinos-server-26bf18266266d8a3957875d0b08ecd457d535410.tar.gz coinos-server-26bf18266266d8a3957875d0b08ecd457d535410.zip | |
Fix bug with currency/symbol settings not being selected properly
Diffstat (limited to 'public/js/setup.js')
| -rw-r--r-- | public/js/setup.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/public/js/setup.js b/public/js/setup.js index ea3808ea..e96bd00d 100644 --- a/public/js/setup.js +++ b/public/js/setup.js @@ -21,20 +21,20 @@ }); $("#currency option[value='CAD']").attr('selected', 'selected'); $('#currency').change(function() { - var symbol, symbols; - $('#symbol option').remove(); - symbol = $(this).val(); - if (!symbol) { + var currency, symbols; + currency = $(this).val(); + if (!currency) { return; } - symbols = Object.keys(data[symbol]); + $('#symbol option').remove(); + symbols = Object.keys(data[currency]); $.each(symbols, function(i, v) { if (v === 'localbitcoins') { return; } return $('#symbol').append("<option value='" + v + "'>" + v + "</option>"); }); - switch ($(this).val()) { + switch (currency) { case 'CAD': return $("#symbol option[value='quadrigacx']").attr('selected', 'selected'); case 'USD': @@ -53,10 +53,11 @@ $('#title').val(data.title); $('#logo').val(data.logo); $('#address').val(data.address); - $("#symbol option[value='" + data.symbol + "']").attr('selected', 'selected'); $('#commission').val(data.commission); $('#unit').val(data.unit); + $("#currency option[value='" + data.currency + "']").attr('selected', 'selected'); $('#currency').change(); + $("#symbol option[value='" + data.symbol + "']").attr('selected', 'selected'); $('#setup').fadeIn(); return $('#title').focus(); }); |
