forked from UKSOURCE/cms.hailearning.edu.vn
add api headermenu and crud management
This commit is contained in:
@@ -120,7 +120,40 @@
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
// Global function to clean up any stuck modal backdrops
|
||||
function forceCleanupModals() {
|
||||
document.body.classList.remove('modal-open');
|
||||
document.body.style.overflow = '';
|
||||
document.body.style.paddingRight = '';
|
||||
const backdrops = document.querySelectorAll('.modal-backdrop, .overlay, .loading');
|
||||
if (backdrops.length > 0) {
|
||||
console.warn('Force removing stuck backdrops:', backdrops.length);
|
||||
backdrops.forEach(el => el.remove());
|
||||
}
|
||||
}
|
||||
|
||||
// Automatically clean up on every hide event
|
||||
document.addEventListener('hidden.bs.modal', function() {
|
||||
// Wait a tiny bit for the animation to finish
|
||||
setTimeout(forceCleanupModals, 100);
|
||||
});
|
||||
|
||||
// Watchdog: Check if backdrops exist without a visible modal every 2 seconds
|
||||
setInterval(() => {
|
||||
const visibleModals = document.querySelectorAll('.modal.show');
|
||||
if (visibleModals.length === 0) {
|
||||
const backdrops = document.querySelectorAll('.modal-backdrop');
|
||||
if (backdrops.length > 0) {
|
||||
forceCleanupModals();
|
||||
}
|
||||
}
|
||||
}, 2000);
|
||||
|
||||
// Clean up on page load
|
||||
window.addEventListener('load', forceCleanupModals);
|
||||
</script>
|
||||
<%- script %>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user