Merge pull request #752 from popod/backend-appointments-modal-improvements

Remove delay before closing the appointments modal.
This commit is contained in:
Alex Tselegidis 2020-05-04 20:53:37 +02:00 committed by GitHub
commit a8394f3adf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 19 deletions

View File

@ -99,16 +99,12 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
// Define success callback.
var successCallback = function (response) {
// Display success message to the user.
$dialog.find('.modal-message').text(EALang.appointment_saved);
$dialog.find('.modal-message').addClass('alert-success').removeClass('alert-danger hidden');
$dialog.find('.modal-body').scrollTop(0);
Backend.displayNotification(EALang.appointment_saved);
// Close the modal dialog and refresh the calendar appointments after one second.
setTimeout(function () {
$dialog.find('.alert').addClass('hidden');
$dialog.modal('hide');
$('#select-filter-item').trigger('change');
}, 2000);
// Close the modal dialog and refresh the calendar appointments.
$dialog.find('.alert').addClass('hidden');
$dialog.modal('hide');
$('#select-filter-item').trigger('change');
};
// Define error callback.

View File

@ -60,17 +60,12 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
var successCallback = function (response) {
// Display success message to the user.
$dialog.find('.modal-message')
.text(EALang.unavailable_saved)
.addClass('alert-success')
.removeClass('alert-danger hidden');
Backend.displayNotification(EALang.unavailable_saved);
// Close the modal dialog and refresh the calendar appointments after one second.
setTimeout(function () {
$dialog.find('.alert').addClass('hidden');
$dialog.modal('hide');
$('#select-filter-item').trigger('change');
}, 2000);
// Close the modal dialog and refresh the calendar appointments.
$dialog.find('.alert').addClass('hidden');
$dialog.modal('hide');
$('#select-filter-item').trigger('change');
};
var errorCallback = function (jqXHR, textStatus, errorThrown) {