mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-26 00:23:33 +03:00
Toggle the first booking step
This commit is contained in:
parent
9681e7d6ad
commit
6226e0f86c
2 changed files with 15 additions and 1 deletions
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div id="wizard-frame-1" class="wizard-frame">
|
<div id="wizard-frame-1" class="wizard-frame" style="visibility: hidden;">
|
||||||
<div class="frame-container">
|
<div class="frame-container">
|
||||||
<h2 class="frame-title"><?= lang('service_and_provider') ?></h2>
|
<h2 class="frame-title"><?= lang('service_and_provider') ?></h2>
|
||||||
|
|
||||||
|
|
|
@ -128,6 +128,10 @@ App.Pages.Booking = (function () {
|
||||||
// If the manage mode is true, the appointment data should be loaded by default.
|
// If the manage mode is true, the appointment data should be loaded by default.
|
||||||
if (manageMode) {
|
if (manageMode) {
|
||||||
applyAppointmentData(vars('appointment_data'), vars('provider_data'), vars('customer_data'));
|
applyAppointmentData(vars('appointment_data'), vars('provider_data'), vars('customer_data'));
|
||||||
|
$('#wizard-frame-1').css({
|
||||||
|
'visibility': 'visible',
|
||||||
|
'display': 'none'
|
||||||
|
}).fadeIn();
|
||||||
} else {
|
} else {
|
||||||
// Check if a specific service was selected (via URL parameter).
|
// Check if a specific service was selected (via URL parameter).
|
||||||
const selectedServiceId = App.Utils.Url.queryParam('service');
|
const selectedServiceId = App.Utils.Url.queryParam('service');
|
||||||
|
@ -160,6 +164,11 @@ App.Pages.Booking = (function () {
|
||||||
(selectedServiceId && selectedProviderId) ||
|
(selectedServiceId && selectedProviderId) ||
|
||||||
(vars('available_services').length === 1 && vars('available_providers').length === 1)
|
(vars('available_services').length === 1 && vars('available_providers').length === 1)
|
||||||
) {
|
) {
|
||||||
|
$('.active-step').removeClass('active-step');
|
||||||
|
$('#step-2').addClass('active-step');
|
||||||
|
$('#wizard-frame-1').hide();
|
||||||
|
$('#wizard-frame-2').fadeIn();
|
||||||
|
|
||||||
$selectService.closest('.wizard-frame').find('.button-next').trigger('click');
|
$selectService.closest('.wizard-frame').find('.button-next').trigger('click');
|
||||||
|
|
||||||
$(document).find('.book-step:first').hide();
|
$(document).find('.book-step:first').hide();
|
||||||
|
@ -173,6 +182,11 @@ App.Pages.Booking = (function () {
|
||||||
.find('strong')
|
.find('strong')
|
||||||
.text(index + 1)
|
.text(index + 1)
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
$('#wizard-frame-1').css({
|
||||||
|
'visibility': 'visible',
|
||||||
|
'display': 'none'
|
||||||
|
}).fadeIn();
|
||||||
}
|
}
|
||||||
|
|
||||||
prefillFromQueryParam('#first-name', 'first_name');
|
prefillFromQueryParam('#first-name', 'first_name');
|
||||||
|
|
Loading…
Reference in a new issue