Make sure the right elements are being used for the booking wizard navigation

This commit is contained in:
Alex Tselegidis 2022-09-18 16:14:29 +03:00
parent 3c1d49dcb3
commit efa2dbcba1

View file

@ -323,7 +323,7 @@ App.Pages.Booking = (function () {
* Some special tasks might be performed, depending on the current wizard step. * Some special tasks might be performed, depending on the current wizard step.
*/ */
$('.button-next').on('click', (event) => { $('.button-next').on('click', (event) => {
const $target = $(event.target); const $target = $(event.currentTarget);
// If we are on the first step and there is no provider selected do not continue with the next step. // If we are on the first step and there is no provider selected do not continue with the next step.
if ($target.attr('data-step_index') === '1' && !$selectProvider.val()) { if ($target.attr('data-step_index') === '1' && !$selectProvider.val()) {
@ -374,9 +374,9 @@ App.Pages.Booking = (function () {
* book wizard. * book wizard.
*/ */
$('.button-back').on('click', (event) => { $('.button-back').on('click', (event) => {
const prevTabIndex = parseInt($(event.target).attr('data-step_index')) - 1; const prevTabIndex = parseInt($(event.currentTarget).attr('data-step_index')) - 1;
$(event.target) $(event.currentTarget)
.parents() .parents()
.eq(1) .eq(1)
.hide('fade', () => { .hide('fade', () => {