Bubble click event through on textbox-question
Rename variable for readability on shop-question-popup
This commit is contained in:
parent
1217d2d333
commit
d3695695e4
3 changed files with 12 additions and 13 deletions
|
|
@ -182,11 +182,11 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
focusSearchInput() {
|
focusSearchInput(event) {
|
||||||
// Focus cursor in input when search icon is clicked
|
// Focus cursor in input when search icon is clicked
|
||||||
const field = document.querySelector("input");
|
const field = document.querySelector("input");
|
||||||
field.focus();
|
field.focus();
|
||||||
this.$emit("search-icon-click");
|
this.$emit("search-icon-click", event);
|
||||||
},
|
},
|
||||||
async imageChanged(e) {
|
async imageChanged(e) {
|
||||||
let file = e.target.files[0];
|
let file = e.target.files[0];
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
cornerStyle="rounded"
|
cornerStyle="rounded"
|
||||||
mask="#####"
|
mask="#####"
|
||||||
:includeSearchIcon="includeSearchIcon"
|
:includeSearchIcon="includeSearchIcon"
|
||||||
@search-icon-click="$emit('search-icon-click')"
|
|
||||||
:displayQuestionText="false"
|
:displayQuestionText="false"
|
||||||
:isRequired="isRequired"
|
:isRequired="isRequired"
|
||||||
:validationRules="computedValidationRules" />
|
:validationRules="computedValidationRules" />
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ export default {
|
||||||
localZipCode: this.zipCodeFromParent,
|
localZipCode: this.zipCodeFromParent,
|
||||||
answers: [],
|
answers: [],
|
||||||
shopListButton: shopListButton,
|
shopListButton: shopListButton,
|
||||||
indexOfLastShopDisplayed: 0,
|
indexOfLastShopToBeDisplayed: 0,
|
||||||
localShopProviderData: this.shopProviderDataFromParent, // Why does parent manage this sometimes, but not all of the time A: to prevent another call to get providers on initial load
|
localShopProviderData: this.shopProviderDataFromParent, // Why does parent manage this sometimes, but not all of the time A: to prevent another call to get providers on initial load
|
||||||
localSelectedProviderNumber: null, // Revisit this, maybe not too hard
|
localSelectedProviderNumber: null, // Revisit this, maybe not too hard
|
||||||
displayInvalidZipAlert: false, // part of big refactor of asyn calls
|
displayInvalidZipAlert: false, // part of big refactor of asyn calls
|
||||||
|
|
@ -158,7 +158,7 @@ export default {
|
||||||
displaySeeMoreLocationsLink() {
|
displaySeeMoreLocationsLink() {
|
||||||
if (!this.shopProviders.length)
|
if (!this.shopProviders.length)
|
||||||
return false;
|
return false;
|
||||||
return this.indexOfLastShopDisplayed < this.shopProviders.length;
|
return this.indexOfLastShopToBeDisplayed < this.shopProviders.length;
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
@ -183,9 +183,9 @@ export default {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const indexOfLastShopToReturn = this.indexOfLastShopDisplayed + numberOfShopsToGet;
|
const indexOfLastShopToReturn = this.indexOfLastShopToBeDisplayed + numberOfShopsToGet;
|
||||||
const nextShopProvidersFromList = this.shopProviders.slice(this.indexOfLastShopDisplayed, indexOfLastShopToReturn);
|
const nextShopProvidersFromList = this.shopProviders.slice(this.indexOfLastShopToBeDisplayed, indexOfLastShopToReturn);
|
||||||
this.indexOfLastShopDisplayed = indexOfLastShopToReturn < this.shopProviders.length ? indexOfLastShopToReturn : this.shopProviders.length;
|
this.indexOfLastShopToBeDisplayed = indexOfLastShopToReturn < this.shopProviders.length ? indexOfLastShopToReturn : this.shopProviders.length;
|
||||||
|
|
||||||
const nextShopAnswersFromList = nextShopProvidersFromList.map((shopProvider) => {
|
const nextShopAnswersFromList = nextShopProvidersFromList.map((shopProvider) => {
|
||||||
const streetAddress = toTitleCase(shopProvider.address.streetAddress);
|
const streetAddress = toTitleCase(shopProvider.address.streetAddress);
|
||||||
|
|
@ -227,9 +227,9 @@ export default {
|
||||||
);
|
);
|
||||||
|
|
||||||
if (selectedProviderNumberFromParentIndex > -1) {
|
if (selectedProviderNumberFromParentIndex > -1) {
|
||||||
this.indexOfLastShopDisplayed = Math.ceil((selectedProviderNumberFromParentIndex + 1) / 3) * 3;
|
this.indexOfLastShopToBeDisplayed = Math.ceil((selectedProviderNumberFromParentIndex + 1) / 3) * 3;
|
||||||
} else {
|
} else {
|
||||||
this.indexOfLastShopDisplayed = 3;
|
this.indexOfLastShopToBeDisplayed = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.localShopProviderData = this.shopProviderDataFromParent;
|
this.localShopProviderData = this.shopProviderDataFromParent;
|
||||||
|
|
@ -304,10 +304,10 @@ export default {
|
||||||
|
|
||||||
// If not found, only show the first 3 shops
|
// If not found, only show the first 3 shops
|
||||||
if (selectedIndex === -1) {
|
if (selectedIndex === -1) {
|
||||||
this.indexOfLastShopDisplayed = 3;
|
this.indexOfLastShopToBeDisplayed = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
const sortedShops = this.getShopsByZip(zipCode, this.shopProviders, this.indexOfLastShopDisplayed);
|
const sortedShops = this.getShopsByZip(zipCode, this.shopProviders, this.indexOfLastShopToBeDisplayed);
|
||||||
|
|
||||||
const toTitleCase = (str) => {
|
const toTitleCase = (str) => {
|
||||||
return str.replace(/\w\S*/g, function (txt) {
|
return str.replace(/\w\S*/g, function (txt) {
|
||||||
|
|
@ -338,7 +338,7 @@ export default {
|
||||||
) {
|
) {
|
||||||
this.localSelectedProviderNumber = null;
|
this.localSelectedProviderNumber = null;
|
||||||
}
|
}
|
||||||
this.indexOfLastShopDisplayed = mappedData.length;
|
this.indexOfLastShopToBeDisplayed = mappedData.length;
|
||||||
this.displayNoShopsAlert = this.answers.length === 0;
|
this.displayNoShopsAlert = this.answers.length === 0;
|
||||||
},
|
},
|
||||||
resetModalButtonStyle() {
|
resetModalButtonStyle() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue