From 33476098c1623ae2dd9a70e670e2f48eeed02694 Mon Sep 17 00:00:00 2001 From: ruralmeltdown Date: Thu, 24 Jul 2025 07:36:30 -0700 Subject: [PATCH] add auto-close to Bootstrap alerts --- app/js/ui/main.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/js/ui/main.js b/app/js/ui/main.js index 97824fcc..406b3620 100644 --- a/app/js/ui/main.js +++ b/app/js/ui/main.js @@ -4,7 +4,7 @@ function msgShow(retcode,msg) { } else if(retcode == 2 || retcode == 1) { var alertType = 'danger'; } - var htmlMsg = ''; + var htmlMsg = ''; return htmlMsg; } @@ -581,3 +581,9 @@ $(document) .ready(contentLoaded) .ready(loadWifiStations()); +// To auto-close Bootstrap alerts; time is in milliseconds +window.setTimeout(function() { + $(".alert").fadeTo(500, 0).slideUp(500, function(){ + $(this).remove(); + }); +}, 5000); \ No newline at end of file