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: {
|
||||
focusSearchInput() {
|
||||
focusSearchInput(event) {
|
||||
// Focus cursor in input when search icon is clicked
|
||||
const field = document.querySelector("input");
|
||||
field.focus();
|
||||
this.$emit("search-icon-click");
|
||||
this.$emit("search-icon-click", event);
|
||||
},
|
||||
async imageChanged(e) {
|
||||
let file = e.target.files[0];
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
cornerStyle="rounded"
|
||||
mask="#####"
|
||||
:includeSearchIcon="includeSearchIcon"
|
||||
@search-icon-click="$emit('search-icon-click')"
|
||||
:displayQuestionText="false"
|
||||
:isRequired="isRequired"
|
||||
:validationRules="computedValidationRules" />
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ export default {
|
|||
localZipCode: this.zipCodeFromParent,
|
||||
answers: [],
|
||||
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
|
||||
localSelectedProviderNumber: null, // Revisit this, maybe not too hard
|
||||
displayInvalidZipAlert: false, // part of big refactor of asyn calls
|
||||
|
|
@ -158,7 +158,7 @@ export default {
|
|||
displaySeeMoreLocationsLink() {
|
||||
if (!this.shopProviders.length)
|
||||
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 nextShopProvidersFromList = this.shopProviders.slice(this.indexOfLastShopDisplayed, indexOfLastShopToReturn);
|
||||
this.indexOfLastShopDisplayed = indexOfLastShopToReturn < this.shopProviders.length ? indexOfLastShopToReturn : this.shopProviders.length;
|
||||
const indexOfLastShopToReturn = this.indexOfLastShopToBeDisplayed + numberOfShopsToGet;
|
||||
const nextShopProvidersFromList = this.shopProviders.slice(this.indexOfLastShopToBeDisplayed, indexOfLastShopToReturn);
|
||||
this.indexOfLastShopToBeDisplayed = indexOfLastShopToReturn < this.shopProviders.length ? indexOfLastShopToReturn : this.shopProviders.length;
|
||||
|
||||
const nextShopAnswersFromList = nextShopProvidersFromList.map((shopProvider) => {
|
||||
const streetAddress = toTitleCase(shopProvider.address.streetAddress);
|
||||
|
|
@ -227,9 +227,9 @@ export default {
|
|||
);
|
||||
|
||||
if (selectedProviderNumberFromParentIndex > -1) {
|
||||
this.indexOfLastShopDisplayed = Math.ceil((selectedProviderNumberFromParentIndex + 1) / 3) * 3;
|
||||
this.indexOfLastShopToBeDisplayed = Math.ceil((selectedProviderNumberFromParentIndex + 1) / 3) * 3;
|
||||
} else {
|
||||
this.indexOfLastShopDisplayed = 3;
|
||||
this.indexOfLastShopToBeDisplayed = 3;
|
||||
}
|
||||
|
||||
this.localShopProviderData = this.shopProviderDataFromParent;
|
||||
|
|
@ -304,10 +304,10 @@ export default {
|
|||
|
||||
// If not found, only show the first 3 shops
|
||||
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) => {
|
||||
return str.replace(/\w\S*/g, function (txt) {
|
||||
|
|
@ -338,7 +338,7 @@ export default {
|
|||
) {
|
||||
this.localSelectedProviderNumber = null;
|
||||
}
|
||||
this.indexOfLastShopDisplayed = mappedData.length;
|
||||
this.indexOfLastShopToBeDisplayed = mappedData.length;
|
||||
this.displayNoShopsAlert = this.answers.length === 0;
|
||||
},
|
||||
resetModalButtonStyle() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue