diff options
| author | Mark Otto <[email protected]> | 2021-01-18 05:10:01 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-01-18 15:10:01 +0200 |
| commit | 4167c107f81aeb2b05e3fe3e2e511b50ea9be640 (patch) | |
| tree | fdb0dc559e16c465081dd7512f2e828032732c3c /site/assets/js | |
| parent | bb19b08fbe41157c5a6e8238ecefda064adda318 (diff) | |
| download | bootstrap-4167c107f81aeb2b05e3fe3e2e511b50ea9be640.tar.xz bootstrap-4167c107f81aeb2b05e3fe3e2e511b50ea9be640.zip | |
Add a live toast example to the docs (#32760)
Diffstat (limited to 'site/assets/js')
| -rw-r--r-- | site/assets/js/application.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/site/assets/js/application.js b/site/assets/js/application.js index 84774a95d..6ff316056 100644 --- a/site/assets/js/application.js +++ b/site/assets/js/application.js @@ -39,7 +39,7 @@ }) } - document.querySelectorAll('.toast') + document.querySelectorAll('.bd-example .toast') .forEach(function (toastNode) { var toast = new bootstrap.Toast(toastNode, { autohide: false @@ -48,6 +48,16 @@ toast.show() }) + var toastTrigger = document.getElementById('liveToastBtn') + var toastLiveExample = document.getElementById('liveToast') + if (toastTrigger) { + toastTrigger.addEventListener('click', function () { + var toast = new bootstrap.Toast(toastLiveExample) + + toast.show() + }) + } + // Demos within modals document.querySelectorAll('.tooltip-test') .forEach(function (tooltip) { |
