Develop #3
@ -28,7 +28,7 @@ export class TouristAttractions {
|
||||
this.events();
|
||||
this.carrossel();
|
||||
this.renderListItems();
|
||||
this.removeSlick();
|
||||
this.slickAdd();
|
||||
}
|
||||
|
||||
selectors () {
|
||||
@ -71,6 +71,25 @@ export class TouristAttractions {
|
||||
}
|
||||
};
|
||||
|
||||
addProperty (e) {
|
||||
e.preventDefault();
|
||||
|
||||
const spotImg = this.spanInput.children[0].src
|
||||
const spotTitle = e.target['input-title'].value
|
||||
const spotDescription = e.target['input-description'].value
|
||||
|
||||
if (spotImg != '' && spotTitle != '' && spotDescription != '') {
|
||||
|
||||
const spot = {
|
||||
image: spotImg,
|
||||
titulo: spotTitle,
|
||||
description: spotDescription,
|
||||
};
|
||||
this.list.push(spot);
|
||||
this.renderListItems();
|
||||
this.resetInputs();
|
||||
}
|
||||
};
|
||||
|
||||
renderListItems () {
|
||||
let spotStructure = '';
|
||||
@ -111,26 +130,14 @@ export class TouristAttractions {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
addProperty (e) {
|
||||
e.preventDefault();
|
||||
|
||||
const spotImg = this.spanInput.children[0].src
|
||||
const spotTitle = e.target['input-title'].value
|
||||
const spotDescription = e.target['input-description'].value
|
||||
|
||||
if (spotImg != '' && spotTitle != '' && spotDescription != '') {
|
||||
|
||||
const spot = {
|
||||
image: spotImg,
|
||||
titulo: spotTitle,
|
||||
description: spotDescription,
|
||||
};
|
||||
this.list.push(spot);
|
||||
this.renderListItems();
|
||||
this.resetInputs();
|
||||
slickAdd () {
|
||||
const ulListSlick = this.ulList;
|
||||
if (ulListSlick.classList.value === 'slick-initialized') {
|
||||
this.carrossel();
|
||||
}else {
|
||||
this.removeSlick();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
resetInputs () {
|
||||
this.inputTitle.value = '';
|
||||
|
Loading…
Reference in New Issue
Block a user