Skip to content

Commit

Permalink
[dev-toasts-initialization] initialize toasts on app start
Browse files Browse the repository at this point in the history
  • Loading branch information
FreexD committed Jan 13, 2021
1 parent 201a967 commit 5e1f480
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/js/tabler.js
Expand Up @@ -44,4 +44,9 @@ import './dropdown';
});
});

let toastsTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="toast"]'));
toastsTriggerList.map(function (toastTriggerEl) {
return new bootstrap.Toast(toastTriggerEl);
});

})();
2 changes: 1 addition & 1 deletion src/pages/_includes/ui/toast.html
@@ -1,6 +1,6 @@
{% assign person-id = include.person-id | default: 2 %}
{% assign person = site.data.people[person-id] %}
<div class="toast show" role="alert" aria-live="assertive" aria-atomic="true" data-autohide="false" data-bs-toggle="toast">
<div class="toast show" role="alert" aria-live="assertive" aria-atomic="true" data-bs-autohide="false" data-bs-toggle="toast">
{% unless include.hide-header %}
<div class="toast-header">
{% include ui/avatar.html person=person class="me-2" size="xs" %}
Expand Down

0 comments on commit 5e1f480

Please sign in to comment.