From 94303cff93611e1f8ea6681febd4cd65f9d1f444 Mon Sep 17 00:00:00 2001 From: gerlofvanek Date: Thu, 13 Jun 2024 00:12:57 +0200 Subject: [PATCH] Fixes and Tweaks - Fix the 25%/50%/100% buttons on XMR and WOW. --- basicswap/templates/wallet.html | 72 ++++++++++++++++----------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/basicswap/templates/wallet.html b/basicswap/templates/wallet.html index 4376a26..30518ed 100644 --- a/basicswap/templates/wallet.html +++ b/basicswap/templates/wallet.html @@ -629,44 +629,44 @@ {# / LTC #} {% else %} - - + var specialCids = [6, 9]; + + if (specialCids.includes(cid) && percent === 1) { + amountInput.setAttribute('data-hidden', 'true'); + amountInput.placeholder = 'Sweep All'; + amountInput.value = ''; + amountInput.disabled = true; + } else if (amountInput.getAttribute('data-hidden') === 'true' && percent !== 1) { + amountInput.value = calculatedAmount.toFixed(8); + amountInput.setAttribute('data-hidden', 'false'); + amountInput.placeholder = ''; + amountInput.disabled = false; + } else { + amountInput.value = calculatedAmount.toFixed(8); + amountInput.placeholder = ''; + amountInput.disabled = false; + } + + var sweepAllCheckbox = document.getElementById('sweepall'); + if (sweepAllCheckbox) { + if (specialCids.includes(cid) && percent === 1) { + sweepAllCheckbox.checked = true; + } else { + sweepAllCheckbox.checked = false; + } + } + } + {% endif %}