Fix issue #546 by adding swal to logouts (#634)

This commit is contained in:
Lance Pioch 2017-09-21 01:16:52 -04:00 committed by Dane Everitt
parent afa328577f
commit 0a0a8784a9
2 changed files with 24 additions and 6 deletions

View file

@ -196,9 +196,18 @@
<script> <script>
$('#logoutButton').on('click', function (event) { $('#logoutButton').on('click', function (event) {
event.preventDefault(); event.preventDefault();
if (confirm('Are you sure you want to logout?')) {
window.location = $(this).attr('href'); var that = this;
} swal({
title: 'Do you want to log out?',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#d9534f',
cancelButtonColor: '#d33',
confirmButtonText: 'Log out'
}, function () {
window.location = $(that).attr('href');
});
}); });
</script> </script>
@endif @endif

View file

@ -289,9 +289,18 @@
<script> <script>
$('#logoutButton').on('click', function (event) { $('#logoutButton').on('click', function (event) {
event.preventDefault(); event.preventDefault();
if (confirm('Are you sure you want to logout?')) {
window.location = $(this).attr('href'); var that = this;
} swal({
title: 'Do you want to log out?',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#d9534f',
cancelButtonColor: '#d33',
confirmButtonText: 'Log out'
}, function () {
window.location = $(that).attr('href');
});
}); });
</script> </script>
@endif @endif