Merge pull request #903 from Safelite/feature/CSR-989

Added check for previous click in footer forward and back button / link
This commit is contained in:
Leah Schumann 2022-12-29 09:40:11 -05:00 committed by GitHub
commit d22bdb98e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,6 +47,8 @@ export default {
return { return {
paddingHeight: 0, paddingHeight: 0,
customButtontext: "", customButtontext: "",
forwardClicked: false,
backClicked: false,
}; };
}, },
mounted() { mounted() {
@ -70,6 +72,15 @@ export default {
? this.customButtontext ? this.customButtontext
: this.getCmsContent(this.cmsWidgetName, "ForwardButtonText"); : this.getCmsContent(this.cmsWidgetName, "ForwardButtonText");
}, },
navigationButtonClicked: {
get: function () {
return this.forwardClicked || this.backClicked;
},
set: function (newValue) {
this.forwardClicked = newValue;
this.backClicked = newValue;
},
},
}, },
methods: { methods: {
onResize() { onResize() {
@ -80,19 +91,29 @@ export default {
}, },
removeLoader() { removeLoader() {
this.$refs.buttonMain.removeLoader(); this.$refs.buttonMain.removeLoader();
document.onkeydown = function (e) { document.onkeydown = function (e) {
return true; return true;
}; };
this.navigationButtonClicked = false;
}, },
buttonClick() { buttonClick() {
//prevent keyboard input after button click //prevent keyboard input after button click
document.onkeydown = function (e) { document.onkeydown = function (e) {
return false; return false;
}; };
this.$emit("ForwardClicked");
if (!this.navigationButtonClicked) {
this.$emit("ForwardClicked");
this.forwardClicked = true;
}
}, },
linkClick() { linkClick() {
this.$emit("BackClicked"); if (!this.navigationButtonClicked) {
this.$emit("BackClicked");
this.backClicked = true;
}
}, },
}, },
}; };