Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions site/assets/js/snippets.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// --------
// Tooltips
// --------
// Instantiate all tooltips in a docs or StackBlitz page
// Instantiate all tooltips in a docs or StackBlitz
document.querySelectorAll('[data-bs-toggle="tooltip"]')
.forEach(tooltip => {
new bootstrap.Tooltip(tooltip)
Expand All @@ -29,7 +29,7 @@
// --------
// Popovers
// --------
// Instantiate all popovers in a docs or StackBlitz page
// Instantiate all popovers in docs or StackBlitz
document.querySelectorAll('[data-bs-toggle="popover"]')
.forEach(popover => {
new bootstrap.Popover(popover)
Expand All @@ -50,7 +50,7 @@
})
}

// Instantiate all toasts in a docs page only
// Instantiate all toasts in docs pages only
document.querySelectorAll('.bd-example .toast')
.forEach(toastNode => {
const toast = new bootstrap.Toast(toastNode, {
Expand All @@ -60,14 +60,14 @@
toast.show()
})

// Instantiate all toasts in a docs page only
// Instantiate all toasts in docs pages only
const toastTrigger = document.getElementById('liveToastBtn')
const toastLiveExample = document.getElementById('liveToast')

if (toastTrigger) {
const toastBootstrap = bootstrap.Toast.getOrCreateInstance(toastLiveExample)
toastTrigger.addEventListener('click', () => {
const toast = new bootstrap.Toast(toastLiveExample)
Comment thread
mdo marked this conversation as resolved.

toast.show()
toastBootstrap.show()
})
}

Expand Down Expand Up @@ -99,7 +99,7 @@
// --------
// Carousels
// --------
// Instantiate all non-autoplaying carousels in a docs or StackBlitz page
// Instantiate all non-autoplaying carousels in docs or StackBlitz
document.querySelectorAll('.carousel:not([data-bs-ride="carousel"])')
.forEach(carousel => {
bootstrap.Carousel.getOrCreateInstance(carousel)
Expand Down
6 changes: 3 additions & 3 deletions site/content/docs/5.3/components/toasts.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ We use the following JavaScript to trigger our live toast demo:
```js
const toastTrigger = document.getElementById('liveToastBtn')
const toastLiveExample = document.getElementById('liveToast')

if (toastTrigger) {
const toastBootstrap = bootstrap.Toast.getOrCreateInstance(toastLiveExample)
toastTrigger.addEventListener('click', () => {
const toast = new bootstrap.Toast(toastLiveExample)
Comment thread
mdo marked this conversation as resolved.

toast.show()
toastBootstrap.show()
})
}
```
Expand Down