From 61facddf24a7085a9d3b8956e19ad85f48a7a641 Mon Sep 17 00:00:00 2001 From: ayan4m1 Date: Sun, 16 Sep 2018 12:14:21 -0400 Subject: [PATCH] use a swal() loader to show test-in-progress state to user --- .../pterodactyl/admin/settings/mail.blade.php | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/resources/themes/pterodactyl/admin/settings/mail.blade.php b/resources/themes/pterodactyl/admin/settings/mail.blade.php index 6d6a3b269..5532d89bd 100644 --- a/resources/themes/pterodactyl/admin/settings/mail.blade.php +++ b/resources/themes/pterodactyl/admin/settings/mail.blade.php @@ -137,17 +137,27 @@ } function testSettings() { - return $.ajax({ - 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' + swal({ + type: 'info', + title: 'Test Mail Settings', + text: 'Click "Test" to begin the test.', + showCancelButton: true, + confirmButtonText: 'Test', + closeOnConfirm: false, + showLoaderOnConfirm: true + }, function () { + $.ajax({ + 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' + }); }); }); }