checkboxes now work properly
This commit is contained in:
parent
aea850c642
commit
5e09802d5e
2 changed files with 25 additions and 1 deletions
|
|
@ -119,6 +119,22 @@ function validateBitcoinMethodCheckboxes(clickedCheckbox) {
|
|||
}
|
||||
}
|
||||
|
||||
function applyTrustCheckboxConstraints(pressedCheckbox) {
|
||||
if (pressedCheckbox === myTrustedTrustedCheckbox) {
|
||||
console.log('first case!');
|
||||
if (!myTrustedTrustedCheckbox.checked && allMembersCheckbox.checked) {
|
||||
allMembersCheckbox.checked = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (pressedCheckbox === allMembersCheckbox) {
|
||||
console.log('second case!');
|
||||
if (!myTrustedTrustedCheckbox.checked && allMembersCheckbox.checked) {
|
||||
myTrustedTrustedCheckbox.checked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function publishOffer() {
|
||||
let wants;
|
||||
if (buyButton.classList.contains('selected')) {
|
||||
|
|
@ -617,6 +633,14 @@ for (const btcMethodCheckbox of btcMethodCheckboxes) {
|
|||
});
|
||||
}
|
||||
|
||||
myTrustedTrustedCheckbox.addEventListener('click', () => {
|
||||
applyTrustCheckboxConstraints(myTrustedTrustedCheckbox);
|
||||
});
|
||||
|
||||
allMembersCheckbox.addEventListener('click', () => {
|
||||
applyTrustCheckboxConstraints(allMembersCheckbox);
|
||||
});
|
||||
|
||||
publishOfferButton.addEventListener('click', async () => {
|
||||
await publishOffer();
|
||||
await myOffers.getOffersFromApi();
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
</div>
|
||||
<div class="over-background" id="view-my-offers-root">
|
||||
<h2>Mis ofertas</h2>
|
||||
<button id="button-start-create-offer" class="button-primary button-medium">Crear nueva oferta</button>
|
||||
<button id="button-start-create-offer" class="button-primary button-medium font-medium">Crear nueva oferta</button>
|
||||
<div id="own-offers-container">
|
||||
<p>Vaya, no hay nada por aquí...</p>
|
||||
Quieres comprar BTC a un premium de 3% (precio: 93.000€/BTC). Quieres
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue