mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-01 04:12:22 +03:00
Skip the first booking step if both service and provider were preselected (#1117).
This commit is contained in:
parent
93aab06187
commit
5982a79852
3 changed files with 40 additions and 2 deletions
|
@ -7,7 +7,17 @@
|
|||
?>
|
||||
|
||||
<div id="header">
|
||||
<span id="company-name"><?= $company_name ?></span>
|
||||
<div id="company-name">
|
||||
<?= $company_name ?>
|
||||
<div class="d-flex justify-content-between">
|
||||
<span class="display-selected-service">
|
||||
|
||||
</span>
|
||||
<span class="display-selected-provider">
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="steps">
|
||||
<div id="step-1" class="book-step active-step"
|
||||
|
|
|
@ -51,6 +51,14 @@ body {
|
|||
font-weight: lighter;
|
||||
color: #fff;
|
||||
margin: 20px 0;
|
||||
|
||||
.display-selected-service,
|
||||
.display-selected-provider {
|
||||
color: #225d4d;
|
||||
font-size: 60%;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#book-appointment-wizard #steps {
|
||||
|
@ -280,7 +288,7 @@ body {
|
|||
#book-appointment-wizard #company-name {
|
||||
display: inline-block;
|
||||
float: left;
|
||||
margin: 10px auto;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#book-appointment-wizard #steps {
|
||||
|
|
|
@ -199,6 +199,22 @@ App.Pages.Booking = (function () {
|
|||
if (selectedProviderId && $selectProvider.find('option[value="' + selectedProviderId + '"]').length > 0) {
|
||||
$selectProvider.val(selectedProviderId).trigger('change');
|
||||
}
|
||||
|
||||
if (selectedServiceId && selectedProviderId) {
|
||||
$selectService.closest('.wizard-frame').find('.button-next').trigger('click');
|
||||
|
||||
$(document).find('.book-step:first').hide();
|
||||
|
||||
$(document).find('.button-back:first').css('visibility', 'hidden');
|
||||
|
||||
$(document)
|
||||
.find('.book-step:not(:first)')
|
||||
.each((index, bookStepEl) =>
|
||||
$(bookStepEl)
|
||||
.find('strong')
|
||||
.text(index + 1)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -571,6 +587,10 @@ App.Pages.Booking = (function () {
|
|||
}
|
||||
});
|
||||
|
||||
$(document).find('.display-selected-service').text($selectService.find('option:selected').text());
|
||||
|
||||
$(document).find('.display-selected-provider').text($selectProvider.find('option:selected').text());
|
||||
|
||||
$('#appointment-details').empty();
|
||||
|
||||
$('<div/>', {
|
||||
|
|
Loading…
Reference in a new issue