mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2025-01-03 04:22:24 +03:00
Select first service and provider if only one option exists
This commit is contained in:
parent
4c7696e877
commit
8dab03f38a
1 changed files with 9 additions and 0 deletions
|
@ -175,6 +175,7 @@ App.Pages.Booking = (function () {
|
|||
// If the manage mode is true, the appointment data should be loaded by default.
|
||||
if (manageMode) {
|
||||
applyAppointmentData(vars('appointment_data'), vars('provider_data'), vars('customer_data'));
|
||||
|
||||
$('#wizard-frame-1')
|
||||
.css({
|
||||
'visibility': 'visible',
|
||||
|
@ -213,6 +214,14 @@ App.Pages.Booking = (function () {
|
|||
(selectedServiceId && selectedProviderId) ||
|
||||
(vars('available_services').length === 1 && vars('available_providers').length === 1)
|
||||
) {
|
||||
if (!selectedServiceId) {
|
||||
$selectService.val(vars('available_services')[0].id).trigger('change');
|
||||
}
|
||||
|
||||
if (!selectedProviderId) {
|
||||
$selectProvider.val(vars('available_providers')[0].id).trigger('change');
|
||||
}
|
||||
|
||||
$('.active-step').removeClass('active-step');
|
||||
$('#step-2').addClass('active-step');
|
||||
$('#wizard-frame-1').hide();
|
||||
|
|
Loading…
Reference in a new issue