NASER add task functions
This commit is contained in:
@@ -464,19 +464,23 @@
|
||||
closeModal()
|
||||
}
|
||||
})
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
function autoDismissFlashMessage() {
|
||||
const errorBox = document.getElementById('error-box')
|
||||
if (errorBox) {
|
||||
// Fade out the error box after 3 seconds
|
||||
setTimeout(() => {
|
||||
errorBox.classList.add('opacity-0') // Add fade-out class
|
||||
// Remove the error box after the fade-out transition ends
|
||||
errorBox.addEventListener('transitionend', () => {
|
||||
errorBox.remove()
|
||||
})
|
||||
}, 3000) // Duration before starting fade out
|
||||
}
|
||||
})
|
||||
if (!errorBox) return
|
||||
|
||||
setTimeout(() => {
|
||||
errorBox.classList.add('opacity-0')
|
||||
errorBox.addEventListener('transitionend', () => {
|
||||
errorBox.remove()
|
||||
})
|
||||
}, 5000)
|
||||
}
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', autoDismissFlashMessage)
|
||||
} else {
|
||||
autoDismissFlashMessage()
|
||||
}
|
||||
</script>
|
||||
@yield('script')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user