All defaults selection logic is working
This commit is contained in:
parent
76b31a3faa
commit
c46d527acb
2 changed files with 12 additions and 13 deletions
|
|
@ -179,14 +179,6 @@ export default {
|
||||||
return tintSourceObject.src;
|
return tintSourceObject.src;
|
||||||
},
|
},
|
||||||
|
|
||||||
// Reset selections when tint changes for the same glass to ensure proper selection.
|
|
||||||
// Also checks if only a single part is present for the tint.
|
|
||||||
ResetTintAndPartSelections() {
|
|
||||||
this.selectedPartNumber = null;
|
|
||||||
this.AutoSelect();
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
AutoSelect() {
|
AutoSelect() {
|
||||||
// Check if only a single part is present for the tint and set the v-model if it is.
|
// Check if only a single part is present for the tint and set the v-model if it is.
|
||||||
if (this.partsForSelectedTint?.length == 1) {
|
if (this.partsForSelectedTint?.length == 1) {
|
||||||
|
|
@ -205,14 +197,22 @@ export default {
|
||||||
document.querySelector('input[value=' + this.selectedPartNumber + ']').checked = true;
|
document.querySelector('input[value=' + this.selectedPartNumber + ']').checked = true;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// Loads the preselected values from the store.
|
// Loads the preselected values from the store.
|
||||||
LoadPreselectedValues() {
|
LoadPreselectedValues() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.modelValue !== undefined) {
|
// Populate button-question model-value if parts data already exists in store
|
||||||
// Populate button-question model-value if parts data already exists in store
|
if(this.modelValue)
|
||||||
this.selectedTint = this.modelValue?.color;
|
{
|
||||||
|
this.selectedTint = this.modelValue.color;
|
||||||
}
|
}
|
||||||
});
|
else{
|
||||||
|
// If one item in list, select it
|
||||||
|
if (this.tintSelectionOptions?.length == 1) {
|
||||||
|
this.selectedTint = this.tintSelectionOptions[0].value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@
|
||||||
cmsWidgetName="SiteFooterWidget"
|
cmsWidgetName="SiteFooterWidget"
|
||||||
ref="siteFooter"
|
ref="siteFooter"
|
||||||
:isForwardActionDisabled="isForwardActionDisabled"
|
:isForwardActionDisabled="isForwardActionDisabled"
|
||||||
@tempButtonClicked="() => handleTempButtonClicked(this)"
|
|
||||||
@backClicked="navigateBack"
|
@backClicked="navigateBack"
|
||||||
@ForwardClicked="forwardButtonAction" />
|
@ForwardClicked="forwardButtonAction" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue