mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Creado popups de alerts para exito y error
This commit is contained in:
@ -63,24 +63,50 @@ if (session()->has('error')) {
|
||||
<?php endif; ?>
|
||||
|
||||
<div id="sk-alert">
|
||||
<div class="alert alert-warning d-flex align-items-baseline" role="alert">
|
||||
<span class="alert-icon alert-icon-lg text-primary me-2">
|
||||
<i class="ti ti-check ti-sm"></i>
|
||||
</span>
|
||||
<div class="d-flex flex-column ps-1">
|
||||
<h5 class="alert-heading mb-2"><?= lang('Basic.global.Warning') ?></h5>
|
||||
<p class="mb-0"><?= $warningMessage; ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?= $this->section('additionalInlineJs') ?>
|
||||
|
||||
$('#sk-alert').on('click', function (e) {
|
||||
function popSuccessAlert(successMsg){
|
||||
var htmlString = `
|
||||
<div class="alert alert-success d-flex align-items-baseline" role="alert">
|
||||
<span class="alert-icon alert-icon-lg text-primary me-2">
|
||||
<i class="ti ti-check ti-sm"></i>
|
||||
</span>
|
||||
<div class="d-flex flex-column ps-1">
|
||||
<h5 class="alert-heading mb-2"><?= lang('Basic.global.Success') ?></h5>
|
||||
<p class="mb-0">` + successMsg + `</p>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
$(this).fadeOut("slow");
|
||||
});
|
||||
$(window).scrollTop(0);
|
||||
$('#sk-alert').hide().empty().html(htmlString).fadeIn("slow", function(){
|
||||
setTimeout(function(){
|
||||
$('#sk-alert').fadeOut("slow");
|
||||
}, 5000);
|
||||
});
|
||||
}
|
||||
|
||||
function popErrorAlert(errorMsg){
|
||||
var htmlString = `
|
||||
<div class="alert alert-error d-flex align-items-baseline" role="alert">
|
||||
<span class="alert-icon alert-icon-lg text-primary me-2">
|
||||
<i class="ti ti-error ti-sm"></i>
|
||||
</span>
|
||||
<div class="d-flex flex-column ps-1">
|
||||
<h5 class="alert-heading mb-2"><?= lang('Basic.global.Error') ?></h5>
|
||||
<p class="mb-0">` + errorMsg + `</p>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
$(window).scrollTop(0);
|
||||
$('#sk-alert').hide().empty().html(htmlString).fadeIn("slow", function(){
|
||||
setTimeout(function(){
|
||||
$('#sk-alert').fadeOut("slow");
|
||||
}, 5000);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
Reference in New Issue
Block a user