ui: New offer, when 'Lock Rate' is set rate must update if it's empty.

Remove invalid coins from coin from list.
This commit is contained in:
tecnovert
2021-12-11 22:11:42 +02:00
parent 001e9976aa
commit 81e9924654
5 changed files with 20 additions and 9 deletions

View File

@@ -23,7 +23,7 @@
<tr><td>Coin From</td><td>
<select id="coin_from" name="coin_from" onchange="set_rate('coin_from');"><option value="-1">-- Select Coin --</option>
{% for c in coins %}
{% for c in coins_from %}
<option{% if data.coin_from==c[0] %} selected{% endif %} value="{{ c[0] }}">{{ c[1] }}</option>
{% endfor %}
</select>
@@ -102,7 +102,7 @@ function set_rate(value_changed) {
const amt_from = document.getElementById('amt_from').value;
const amt_to = document.getElementById('amt_to').value;
const rate = document.getElementById('rate').value;
const lock_rate = document.getElementById('rate_lock').checked;
const lock_rate = rate == '' ? false : document.getElementById('rate_lock').checked;
if (coin_from == '-1' || coin_to == '-1') {
return;