mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-09 01:23:10 +03:00
Remove timeout before closing the extra periods modal on success.
This commit is contained in:
parent
07276d46a6
commit
9905c942ac
1 changed files with 18 additions and 23 deletions
|
@ -59,33 +59,28 @@ window.BackendCalendarExtraPeriodsModal = window.BackendCalendarExtraPeriodsModa
|
||||||
|
|
||||||
var successCallback = function (response) {
|
var successCallback = function (response) {
|
||||||
// Display success message to the user.
|
// Display success message to the user.
|
||||||
$dialog.find('.modal-message')
|
Backend.displayNotification(EALang.extra_period_saved);
|
||||||
.text(EALang.extra_period_saved)
|
|
||||||
.addClass('alert-success')
|
|
||||||
.removeClass('alert-danger hidden');
|
|
||||||
|
|
||||||
// Close the modal dialog and refresh the calendar appointments after one second.
|
// Close the modal dialog and refresh the calendar appointments.
|
||||||
setTimeout(function () {
|
$dialog.find('.alert').addClass('hidden');
|
||||||
$dialog.find('.alert').addClass('hidden');
|
$dialog.modal('hide');
|
||||||
$dialog.modal('hide');
|
|
||||||
|
|
||||||
var providerId = $('#extra-provider').val();
|
var providerId = $('#extra-provider').val();
|
||||||
var provider = GlobalVariables.availableProviders.filter(function (p) {
|
var provider = GlobalVariables.availableProviders.filter(function (p) {
|
||||||
return p.id === providerId;
|
return p.id === providerId;
|
||||||
})[0];
|
})[0];
|
||||||
var providerIdx = GlobalVariables.availableProviders.indexOf(provider);
|
var providerIdx = GlobalVariables.availableProviders.indexOf(provider);
|
||||||
|
|
||||||
var extraWorkingPlan = jQuery.parseJSON(provider.settings.extra_working_plan);
|
var extraWorkingPlan = jQuery.parseJSON(provider.settings.extra_working_plan);
|
||||||
extraWorkingPlan[start.toString('yyyy-MM-dd')] = {
|
extraWorkingPlan[start.toString('yyyy-MM-dd')] = {
|
||||||
start: start.toString('HH:mm'),
|
start: start.toString('HH:mm'),
|
||||||
end: end.toString('HH:mm'),
|
end: end.toString('HH:mm'),
|
||||||
breaks: []
|
breaks: []
|
||||||
};
|
};
|
||||||
provider.settings.extra_working_plan = JSON.stringify(extraWorkingPlan);
|
provider.settings.extra_working_plan = JSON.stringify(extraWorkingPlan);
|
||||||
GlobalVariables.availableProviders[providerIdx] = provider;
|
GlobalVariables.availableProviders[providerIdx] = provider;
|
||||||
|
|
||||||
$('#select-filter-item').trigger('change');
|
$('#select-filter-item').trigger('change');
|
||||||
}, 2000);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var errorCallback = function (jqXHR, textStatus, errorThrown) {
|
var errorCallback = function (jqXHR, textStatus, errorThrown) {
|
||||||
|
|
Loading…
Reference in a new issue