Skip to content

Commit 0a0a878

Browse files
lancepiochDaneEveritt
authored andcommitted
Fix issue pterodactyl#546 by adding swal to logouts (pterodactyl#634)
1 parent afa3285 commit 0a0a878

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

resources/themes/pterodactyl/layouts/admin.blade.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,18 @@
196196
<script>
197197
$('#logoutButton').on('click', function (event) {
198198
event.preventDefault();
199-
if (confirm('Are you sure you want to logout?')) {
200-
window.location = $(this).attr('href');
201-
}
199+
200+
var that = this;
201+
swal({
202+
title: 'Do you want to log out?',
203+
type: 'warning',
204+
showCancelButton: true,
205+
confirmButtonColor: '#d9534f',
206+
cancelButtonColor: '#d33',
207+
confirmButtonText: 'Log out'
208+
}, function () {
209+
window.location = $(that).attr('href');
210+
});
202211
});
203212
</script>
204213
@endif

resources/themes/pterodactyl/layouts/master.blade.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,18 @@ class="active"
289289
<script>
290290
$('#logoutButton').on('click', function (event) {
291291
event.preventDefault();
292-
if (confirm('Are you sure you want to logout?')) {
293-
window.location = $(this).attr('href');
294-
}
292+
293+
var that = this;
294+
swal({
295+
title: 'Do you want to log out?',
296+
type: 'warning',
297+
showCancelButton: true,
298+
confirmButtonColor: '#d9534f',
299+
cancelButtonColor: '#d33',
300+
confirmButtonText: 'Log out'
301+
}, function () {
302+
window.location = $(that).attr('href');
303+
});
295304
});
296305
</script>
297306
@endif

0 commit comments

Comments
 (0)