button toggling works
This commit is contained in:
parent
e6e2f42f86
commit
7afe8b2665
2 changed files with 25 additions and 2 deletions
|
|
@ -22,3 +22,19 @@ buttonStartCreateOffer.addEventListener('click', () => {
|
||||||
closeOfferControls.addEventListener('click', () => {
|
closeOfferControls.addEventListener('click', () => {
|
||||||
toggleCreateOfferControls();
|
toggleCreateOfferControls();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function toggleBuyOrSellButtonGroup() {
|
||||||
|
buyOrSellButtons.forEach((button) => {
|
||||||
|
if (button.classList.contains('selected')) {
|
||||||
|
button.classList.remove('selected');
|
||||||
|
} else {
|
||||||
|
button.classList.add('selected');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
buyOrSellButtons.forEach((button) => {
|
||||||
|
button.addEventListener('click', () => {
|
||||||
|
toggleBuyOrSellButtonGroup();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,15 @@
|
||||||
/>
|
/>
|
||||||
<p>Añade los detalles de tu oferta</p>
|
<p>Añade los detalles de tu oferta</p>
|
||||||
<div id="button-group-buy-or-sell" class="button-group">
|
<div id="button-group-buy-or-sell" class="button-group">
|
||||||
<button class="selected">Quiero comprar Bitcoin</button
|
<button
|
||||||
><button>Quiero vender Bitcoin</button>
|
data-value="buy-bitcoin"
|
||||||
|
id="button-buy-bitcoin"
|
||||||
|
class="selected"
|
||||||
|
>
|
||||||
|
Quiero comprar Bitcoin</button
|
||||||
|
><button data-value="sell-bitcoin" id="button-sell-bitcoin">
|
||||||
|
Quiero vender Bitcoin
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<button id="button-submit-offer" class="button-primary" disabled>
|
<button id="button-submit-offer" class="button-primary" disabled>
|
||||||
Publicar oferta
|
Publicar oferta
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue