use a swal() loader to show test-in-progress state to user
This commit is contained in:
parent
006832de21
commit
61facddf24
1 changed files with 21 additions and 11 deletions
|
@ -137,17 +137,27 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function testSettings() {
|
function testSettings() {
|
||||||
return $.ajax({
|
swal({
|
||||||
method: 'GET',
|
type: 'info',
|
||||||
url: Router.route('admin.settings.mail.test'),
|
title: 'Test Mail Settings',
|
||||||
headers: { 'X-CSRF-Token': $('input[name="_token"]').val() }
|
text: 'Click "Test" to begin the test.',
|
||||||
}).fail(function (jqXHR) {
|
showCancelButton: true,
|
||||||
showErrorDialog(jqXHR, 'test');
|
confirmButtonText: 'Test',
|
||||||
}).done(function () {
|
closeOnConfirm: false,
|
||||||
swal({
|
showLoaderOnConfirm: true
|
||||||
title: 'Success',
|
}, function () {
|
||||||
text: 'The test message was sent successfully.',
|
$.ajax({
|
||||||
type: 'success'
|
method: 'GET',
|
||||||
|
url: Router.route('admin.settings.mail.test'),
|
||||||
|
headers: { 'X-CSRF-Token': $('input[name="_token"]').val() }
|
||||||
|
}).fail(function (jqXHR) {
|
||||||
|
showErrorDialog(jqXHR, 'test');
|
||||||
|
}).done(function () {
|
||||||
|
swal({
|
||||||
|
title: 'Success',
|
||||||
|
text: 'The test message was sent successfully.',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue