Add SweetAlert2 availability check and fallback to standard confirm dialog for logout
This commit is contained in:
@@ -802,6 +802,9 @@
|
||||
function confirmLogout(event) {
|
||||
event.preventDefault();
|
||||
var logoutUrl = event.currentTarget.href;
|
||||
|
||||
// Check if SweetAlert2 is available
|
||||
if (typeof Swal !== 'undefined' && Swal.fire) {
|
||||
Swal.fire({
|
||||
title: 'Konfirmasi Logout',
|
||||
text: 'Apakah Anda yakin akan keluar dari sistem?',
|
||||
@@ -816,6 +819,12 @@
|
||||
window.location.href = logoutUrl;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Fallback to standard confirm dialog
|
||||
if (confirm('Apakah Anda yakin akan keluar dari sistem?')) {
|
||||
window.location.href = logoutUrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function zoomIn() {
|
||||
|
||||
Reference in New Issue
Block a user