refactor place input out
This commit is contained in:
parent
bc4cb35a31
commit
e95d240562
1 changed files with 26 additions and 0 deletions
26
src/front/components/PlaceInput.js
Normal file
26
src/front/components/PlaceInput.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
class PlaceInput {
|
||||
constructor({ parentElement, id }) {
|
||||
this.element = null;
|
||||
this.parentElement = parentElement;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
render() {
|
||||
const placeInput = document.createElement('textarea');
|
||||
placeInput.id = 'place-input';
|
||||
placeInput.className = 'place-and-time-box';
|
||||
placeInput.autocomplete = 'on';
|
||||
placeInput.maxLength = 140;
|
||||
placeInput.placeholder =
|
||||
"¿Dónde? Ej.'Eixample', 'La Maquinista', 'Cualquier lugar en BCN', 'Meetup BBO'";
|
||||
|
||||
this.element = placeInput;
|
||||
this.parentElement.appendChild(this.element);
|
||||
}
|
||||
|
||||
get inputText() {
|
||||
return this.element.value;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = PlaceInput;
|
||||
Loading…
Add table
Add a link
Reference in a new issue