mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-24 17:03:27 +03:00
Keep the same provider while changing services (if possible).
This commit is contained in:
parent
03fbc518da
commit
afe06721f7
1 changed files with 6 additions and 0 deletions
|
@ -329,6 +329,8 @@ App.Components.AppointmentsModal = (function () {
|
||||||
$selectService.on('change', () => {
|
$selectService.on('change', () => {
|
||||||
const serviceId = $selectService.val();
|
const serviceId = $selectService.val();
|
||||||
|
|
||||||
|
const providerId = $selectProvider.val();
|
||||||
|
|
||||||
$selectProvider.empty();
|
$selectProvider.empty();
|
||||||
|
|
||||||
// Automatically update the service duration.
|
// Automatically update the service duration.
|
||||||
|
@ -364,6 +366,10 @@ App.Components.AppointmentsModal = (function () {
|
||||||
$selectProvider.append(new Option(provider.first_name + ' ' + provider.last_name, provider.id));
|
$selectProvider.append(new Option(provider.first_name + ' ' + provider.last_name, provider.id));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if ($selectProvider.find(`option[value="${providerId}"]`).length) {
|
||||||
|
$selectProvider.val(providerId);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue