diff options
author | Martijn Cuppens <martijn.cuppens@gmail.com> | 2020-11-29 17:58:44 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2020-12-04 17:15:51 +0300 |
commit | 6c069b697614a4ab9053c4f6d4a3aad75fbcaf97 (patch) | |
tree | d958f6914726b0089fa18a3d6fe0d7bab6d6c61e /site/assets/js | |
parent | 5b0dcf8ffe6ae121722c9db571294e715b7ec52a (diff) |
Add interactive positioning widget
Diffstat (limited to 'site/assets/js')
-rw-r--r-- | site/assets/js/application.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/site/assets/js/application.js b/site/assets/js/application.js index 58f4e23bf2..7f6752d2cd 100644 --- a/site/assets/js/application.js +++ b/site/assets/js/application.js @@ -28,6 +28,17 @@ new bootstrap.Popover(popover) }) + var toastPlacement = document.getElementById('toastPlacement') + if (toastPlacement) { + document.getElementById('selectToastPlacement').addEventListener('change', function () { + if (!toastPlacement.dataset.originalClass) { + toastPlacement.dataset.originalClass = toastPlacement.className + } + + toastPlacement.className = toastPlacement.dataset.originalClass + ' ' + this.value + }) + } + document.querySelectorAll('.toast') .forEach(function (toastNode) { var toast = new bootstrap.Toast(toastNode, { |