Skip to content

Commit

Permalink
Merge pull request #2194 from laws-africa/bootstrap-alerts
Browse files Browse the repository at this point in the history
use new bootstrap to dismiss alerts
  • Loading branch information
longhotsummer authored Aug 15, 2024
2 parents 7f949fe + 05500d0 commit f74c025
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion indigo_app/static/javascript/indigo/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ $(function() {

// Toasts should disappear after a few seconds
function nukeToasts() {
$('.alert-dismissible.auto-dismiss').alert('close');
for (let el of document.querySelectorAll('.alert-dismissible.auto-dismiss')) {
bootstrap.Alert.getOrCreateInstance(el).close();
}
}
setTimeout(nukeToasts, 3 * 1000);
});

0 comments on commit f74c025

Please sign in to comment.