diff options
author | Mark Otto <markd.otto@gmail.com> | 2021-01-18 16:10:01 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-18 16:10:01 +0300 |
commit | 4167c107f81aeb2b05e3fe3e2e511b50ea9be640 (patch) | |
tree | fdb0dc559e16c465081dd7512f2e828032732c3c /site/assets/js | |
parent | bb19b08fbe41157c5a6e8238ecefda064adda318 (diff) |
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 84774a95d5..6ff3160563 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) { |