25 lines
679 B
JavaScript
25 lines
679 B
JavaScript
/**
|
|
* Main JavaScript File for Hospital Payroll Management System
|
|
*/
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
console.log('Hospital Payroll Management System - Initialized');
|
|
|
|
// Setup global CSRF token for AJAX requests if available
|
|
const csrfToken = document.querySelector('meta[name="csrf-token"]');
|
|
if (csrfToken) {
|
|
// Axios or fetch interceptor can be setup here
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Utility to toggle loading state on buttons
|
|
*/
|
|
function toggleButtonLoading(buttonElement, isLoading) {
|
|
if (isLoading) {
|
|
buttonElement.classList.add('btn-loading');
|
|
} else {
|
|
buttonElement.classList.remove('btn-loading');
|
|
}
|
|
}
|