big notes with object
This commit is contained in:
parent
754c3cf02e
commit
0a34622a02
2 changed files with 41 additions and 14 deletions
|
|
@ -8,6 +8,41 @@ const TimeInput = require('../components/TimeInput');
|
|||
const BitcoinMethodCheckboxes = require('../components/BitcoinMethodCheckboxes');
|
||||
const TrustCheckboxes = require('../components/TrustCheckboxes');
|
||||
|
||||
class BigNotesCheckbox {
|
||||
constructor({parentElement}) {
|
||||
this.bigNotesContainer = null;
|
||||
this.bigNotesCheckboxElement = null;
|
||||
this.parentElement = parentElement;
|
||||
}
|
||||
|
||||
render() {
|
||||
const container = document.createElement('div');
|
||||
container.id = 'large-bills-area';
|
||||
container.className = 'checkbox-row';
|
||||
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.name = 'large-bills';
|
||||
checkbox.id = 'large-bills-checkbox';
|
||||
|
||||
const label = document.createElement('label');
|
||||
label.htmlFor = 'large-bills-checkbox';
|
||||
label.textContent = 'Se pueden usar billetes grandes (100€, 200€, 500€)';
|
||||
|
||||
container.appendChild(checkbox);
|
||||
container.appendChild(label);
|
||||
|
||||
this.bigNotesContainer = container;
|
||||
this.bigNotesCheckboxElement = checkbox;
|
||||
|
||||
this.parentElement.append(this.bigNotesContainer);
|
||||
}
|
||||
|
||||
get areBigNotesAccepted(){
|
||||
return this.bigNotesCheckboxElement.checked;
|
||||
}
|
||||
}
|
||||
|
||||
function offersPage() {
|
||||
const createOfferEventBus = new EventTarget();
|
||||
|
||||
|
|
@ -85,6 +120,11 @@ function offersPage() {
|
|||
|
||||
trustCheckboxes.render();
|
||||
|
||||
const bigNotesCheckbox = new BigNotesCheckbox({
|
||||
parentElement: document.getElementById('other-area')
|
||||
})
|
||||
|
||||
bigNotesCheckbox.render();
|
||||
// -----------
|
||||
const navbuttonHome = document.getElementById('navbutton-home');
|
||||
const navbuttonOffers = document.getElementById('navbutton-offers');
|
||||
|
|
@ -107,10 +147,6 @@ function offersPage() {
|
|||
);
|
||||
const viewMyOffersRoot = document.getElementById('view-my-offers-root');
|
||||
|
||||
const bigNotesAcceptedCheckbox = document.getElementById(
|
||||
'large-bills-checkbox'
|
||||
);
|
||||
|
||||
const offerCreatedPopup = document.getElementById(
|
||||
'offer-created-confirmation'
|
||||
);
|
||||
|
|
@ -142,7 +178,7 @@ function offersPage() {
|
|||
const show_offer_to_trusted_trusted =
|
||||
trustCheckboxes.showOfferToTrustedTrusted;
|
||||
const show_offer_to_all_members = trustCheckboxes.showOfferToAllMembers;
|
||||
const are_big_notes_accepted = bigNotesAcceptedCheckbox.checked;
|
||||
const are_big_notes_accepted = bigNotesCheckbox.areBigNotesAccepted;
|
||||
|
||||
const offerDetails = {
|
||||
wants,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue