From 72d5673e37d268a40d4d81287b05d6278f7166d4 Mon Sep 17 00:00:00 2001 From: imnavajas Date: Wed, 8 Nov 2023 09:00:23 +0100 Subject: [PATCH] =?UTF-8?q?A=C3=B1adida=20funcionalidad=20de=20generar=20a?= =?UTF-8?q?lertas=20en=20base=20al=20id=20de=20un=20contenedor=20especific?= =?UTF-8?q?o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../themes/_commonPartialsBs/_alertBoxes.php | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) 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); }