mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
cargando datos
This commit is contained in:
@ -21,10 +21,13 @@ if (session()->has('error')) {
|
||||
<div id="sk-alert">
|
||||
</div>
|
||||
|
||||
<div id="sk-alert-2">
|
||||
</div>
|
||||
|
||||
|
||||
<?= $this->section('globalJsFunctions') ?>
|
||||
|
||||
function popAlert(message, alertClass, alertIcon, containerId = 'sk-alert'){
|
||||
function popAlert(message, alertClass, alertIcon, containerId = 'sk-alert', fade = true){
|
||||
var htmlString = `
|
||||
<div class="alert ${alertClass} d-flex align-items-baseline" role="alert">
|
||||
<span class="alert-icon alert-icon-lg text-primary me-2">
|
||||
@ -37,25 +40,39 @@ function popAlert(message, alertClass, alertIcon, containerId = 'sk-alert'){
|
||||
if(containerId == 'sk-alert'){
|
||||
$(window).scrollTop(0);
|
||||
}
|
||||
$('#' + containerId).hide().empty().html(htmlString).fadeIn("slow", function(){
|
||||
if(fade){
|
||||
$('#' + containerId).hide().empty().html(htmlString).fadeIn("slow", function(){
|
||||
setTimeout(function(){
|
||||
$('#' + containerId).fadeOut("slow");
|
||||
}, 5000);
|
||||
});
|
||||
}
|
||||
else{
|
||||
$('#' + containerId).hide().empty().html(htmlString).fadeIn("slow");
|
||||
$('html, body').animate({ scrollTop: 0 }, 500);
|
||||
}
|
||||
}
|
||||
|
||||
function popSuccessAlert(successMsg, containerId = 'sk-alert', fade = true){
|
||||
popAlert(successMsg, "alert-success", "ti-check", containerId, fade);
|
||||
}
|
||||
|
||||
function popWarningAlert(warningMsg, containerId = 'sk-alert', fade = true){
|
||||
popAlert(warningMsg, "alert-warning", "ti-bell", containerId, fade);
|
||||
}
|
||||
|
||||
function popErrorAlert(errorMsg, containerId = 'sk-alert', fade = true){
|
||||
popAlert(errorMsg, "alert-danger", "ti-ban", containerId, fade);
|
||||
}
|
||||
|
||||
function popAlert2Hide(containerId = 'sk-alert-2'){
|
||||
$('#' + containerId).hide().empty().fadeIn("slow", function(){
|
||||
setTimeout(function(){
|
||||
$('#' + containerId).fadeOut("slow");
|
||||
}, 5000);
|
||||
}, 2000);
|
||||
});
|
||||
}
|
||||
|
||||
function popSuccessAlert(successMsg, containerId = 'sk-alert'){
|
||||
popAlert(successMsg, "alert-success", "ti-check", containerId);
|
||||
}
|
||||
|
||||
function popWarningAlert(warningMsg, containerId = 'sk-alert'){
|
||||
popAlert(warningMsg, "alert-warning", "ti-bell", containerId);
|
||||
}
|
||||
|
||||
function popErrorAlert(errorMsg, containerId = 'sk-alert'){
|
||||
popAlert(errorMsg, "alert-danger", "ti-ban", containerId);
|
||||
}
|
||||
|
||||
<?php if (isset($successMessage) && $successMessage){ ?>
|
||||
popSuccessAlert(`<?= $successMessage ?>`);
|
||||
<?php } ?>
|
||||
|
||||
Reference in New Issue
Block a user