diff --git a/src/public/css/seca.css b/src/public/css/seca.css index 8704708..629ba1a 100644 --- a/src/public/css/seca.css +++ b/src/public/css/seca.css @@ -1,5 +1,5 @@ * { - font-family: 'Courier New', Courier, monospace; + font-family: Arial, Helvetica, sans-serif; box-sizing: border-box; } diff --git a/src/public/javascript/offers.js b/src/public/javascript/offers.js index 8d0104c..eaa49cc 100644 --- a/src/public/javascript/offers.js +++ b/src/public/javascript/offers.js @@ -29,6 +29,8 @@ const btcMethodCheckboxesWarning = document.getElementById( const btcMethodCheckboxes = [onchainCheckbox, lightningCheckbox]; +const publishOfferButton = document.getElementById('button-submit-offer'); + function toggleCreateOfferControls() { createOfferControls.style.display = createOfferControls.style.display === 'block' ? 'none' : 'block'; @@ -92,19 +94,10 @@ function updateBtcInput() { btcAmountInput.value = formattedSatsAmount; } -function validateBitcoinMethodCheckboxes() { - let noneChecked = true; - - for (const aCheckbox of btcMethodCheckboxes) { - if (aCheckbox.checked) { - noneChecked = false; - } - } - - if (noneChecked) { - btcMethodCheckboxesWarning.style.display = 'block'; - } else { - btcMethodCheckboxesWarning.style.display = 'none'; +function validateBitcoinMethodCheckboxes(clickedCheckbox) { + let checkedCount = btcMethodCheckboxes.filter((cb) => cb.checked).length; + if (checkedCount === 0) { + clickedCheckbox.checked = true; } } @@ -141,7 +134,9 @@ eurAmountInput.addEventListener('input', () => { }); for (const btcMethodCheckbox of btcMethodCheckboxes) { - btcMethodCheckbox.addEventListener('input', () => { - validateBitcoinMethodCheckboxes(); + btcMethodCheckbox.addEventListener('click', () => { + validateBitcoinMethodCheckboxes(btcMethodCheckbox); }); } + +updateBtcInput(); diff --git a/src/views/offers.ejs b/src/views/offers.ejs index f8928e9..ffa747d 100644 --- a/src/views/offers.ejs +++ b/src/views/offers.ejs @@ -70,7 +70,7 @@ id="input-eur-amount" type="text" class="money-input input-money-amount" - placeholder="100" + value="100" required />
@@ -162,7 +162,7 @@
<%- include("partials/appCommonScripts") %> - +