Performance optimization in backend calendar page, after the user clicks the insert appointment button. (#500)

This commit is contained in:
alext 2018-06-24 19:42:42 +02:00
parent 58ab2b0c8e
commit caa45a65f1
2 changed files with 11 additions and 10 deletions

View file

@ -12,7 +12,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- #480: Make the app GDPR - new EU privacy regulations compliant. - #480: Make the app GDPR - new EU privacy regulations compliant.
- #489: REST API response headers must use the Content-Type application/json value. - #489: REST API response headers must use the Content-Type application/json value.
- #500: Performance optimization in backend calendar page, after the user clicks the insert appointment button.
## [1.3.1] ## [1.3.1]
### Added ### Added

View file

@ -127,16 +127,16 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
// Set the selected filter item and find the next appointment time as the default modal values. // Set the selected filter item and find the next appointment time as the default modal values.
if ($('#select-filter-item option:selected').attr('type') == 'provider') { if ($('#select-filter-item option:selected').attr('type') == 'provider') {
var $providerOption = $dialog.find('#select-provider option[value="' var providerId = $('#select-filter-item').val();
+ $('#select-filter-item').val() + '"]');
if ($providerOption.length === 0) { // Change the services until you find the correct. var providers = GlobalVariables.availableProviders.filter(function (provider) {
$.each($dialog.find('#select-service option'), function () { return provider.id == providerId;
$(this).prop('selected', true).parent().change(); });
if ($providerOption.length > 0)
return false; if (providers.length) {
}); $dialog.find('#select-service').val(providers[0].services[0]).trigger('change');
$dialog.find('#select-provider').val(providerId);
} }
$providerOption.prop('selected', true);
} else { } else {
$dialog.find('#select-service option[value="' $dialog.find('#select-service option[value="'
+ $('#select-filter-item').val() + '"]').prop('selected', true); + $('#select-filter-item').val() + '"]').prop('selected', true);