2021-10-05 21:40:15 +02:00
|
|
|
<div aria-live="polite" aria-atomic="true" class="position-relative z-index-master">
|
|
|
|
<div class="toast-container position-absolute start-50 translate-middle-x mt-3" style="z-index:1100;">
|
2021-01-16 13:03:16 +01:00
|
|
|
<div id="alert" class="toast text-center text-white border-0 p-3" role="alert" aria-live="assertive" aria-atomic="true">
|
|
|
|
Hello, I'm a Bludit alert!
|
2021-01-01 23:13:01 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
2021-06-07 19:52:26 +02:00
|
|
|
function showAlert(text, background='primary') {
|
|
|
|
$('#alert').removeClass('bg-danger bg-warning bg-primary').addClass('bg-'+background);
|
|
|
|
$('#alert').html(text);
|
|
|
|
$('#alert').toast('show');
|
|
|
|
}
|
2021-01-01 23:13:01 +01:00
|
|
|
|
2021-06-07 19:52:26 +02:00
|
|
|
function showAlertError(text) {
|
|
|
|
showAlert(text, 'danger');
|
|
|
|
}
|
2021-01-12 21:46:42 +01:00
|
|
|
|
2021-06-07 19:52:26 +02:00
|
|
|
function showAlertWarning(text) {
|
|
|
|
showAlert(text, 'warning');
|
|
|
|
}
|
2021-01-12 21:46:42 +01:00
|
|
|
|
2021-06-07 19:52:26 +02:00
|
|
|
function showAlertInfo(text) {
|
|
|
|
showAlert(text, 'primary');
|
|
|
|
}
|
2021-01-12 21:46:42 +01:00
|
|
|
|
2021-06-07 19:52:26 +02:00
|
|
|
function hideAlert(text) {
|
|
|
|
$('#alert').toast('hide');
|
|
|
|
}
|
2021-01-01 23:13:01 +01:00
|
|
|
</script>
|