diff --git a/ci4/app/Views/themes/_commonPartialsBs/_alertBoxes.php b/ci4/app/Views/themes/_commonPartialsBs/_alertBoxes.php index ab60abcd..9c195cfb 100644 --- a/ci4/app/Views/themes/_commonPartialsBs/_alertBoxes.php +++ b/ci4/app/Views/themes/_commonPartialsBs/_alertBoxes.php @@ -24,7 +24,7 @@ if (session()->has('error')) { section('additionalInlineJs') ?> -function popAlert(message, alertClass, alertIcon){ +function popAlert(message, alertClass, alertIcon, containerId = 'sk-alert'){ var htmlString = ` `; - $(window).scrollTop(0); - $('#sk-alert').hide().empty().html(htmlString).fadeIn("slow", function(){ + if(containerId == 'sk-alert'){ + $(window).scrollTop(0); + } + $('#' + containerId).hide().empty().html(htmlString).fadeIn("slow", function(){ setTimeout(function(){ - $('#sk-alert').fadeOut("slow"); + $('#' + containerId).fadeOut("slow"); }, 5000); }); } -function popSuccessAlert(successMsg){ - popAlert(successMsg, "alert-success", "ti-check"); +function popSuccessAlert(successMsg, containerId = 'sk-alert'){ + popAlert(successMsg, "alert-success", "ti-check", containerId); } -function popWarningAlert(warningMsg){ - popAlert(warningMsg, "alert-warning", "ti-bell"); +function popWarningAlert(warningMsg, containerId = 'sk-alert'){ + popAlert(warningMsg, "alert-warning", "ti-bell", containerId); } -function popErrorAlert(errorMsg){ - popAlert(errorMsg, "alert-danger", "ti-ban"); +function popErrorAlert(errorMsg, containerId = 'sk-alert'){ + popAlert(errorMsg, "alert-danger", "ti-ban", containerId); }