move to file
This commit is contained in:
parent
0a34622a02
commit
a9779c207e
2 changed files with 39 additions and 37 deletions
|
|
@ -7,41 +7,7 @@ const PlaceInput = require('../components/PlaceInput');
|
|||
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;
|
||||
}
|
||||
}
|
||||
const BigNotesCheckbox = require('../components/BigNotesCheckbox');
|
||||
|
||||
function offersPage() {
|
||||
const createOfferEventBus = new EventTarget();
|
||||
|
|
@ -121,8 +87,8 @@ function offersPage() {
|
|||
trustCheckboxes.render();
|
||||
|
||||
const bigNotesCheckbox = new BigNotesCheckbox({
|
||||
parentElement: document.getElementById('other-area')
|
||||
})
|
||||
parentElement: document.getElementById('other-area'),
|
||||
});
|
||||
|
||||
bigNotesCheckbox.render();
|
||||
// -----------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue