From 618a046b646d87f7f547d2f225ec6ddb5dcae048 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 22 Oct 2017 15:07:17 +0200 Subject: [PATCH] Auto dismissal for info and error notifications Signed-off-by: DL6ER --- scripts/pi-hole/js/settings.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/pi-hole/js/settings.js b/scripts/pi-hole/js/settings.js index e9217ea8..a9c4706f 100644 --- a/scripts/pi-hole/js/settings.js +++ b/scripts/pi-hole/js/settings.js @@ -199,3 +199,17 @@ $(".nav-tabs a").on("shown.bs.tab", function (e) { window.location.hash = e.target.hash; window.scrollTo(0, 0); }); + +// Auto dismissal for info and error notifications +$(document).ready(function(){ + var alInfo = $("#alInfo"); + var alError = $("#alError"); + if(alInfo.length) + { + alInfo.delay(1000).fadeOut(2000, function() { alInfo.hide(); }); + } + if(alError.length) + { + alError.delay(1000).fadeOut(2000, function() { alError.hide(); }); + } +});