1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-20 12:21:35 +02:00

Add interactive positioning widget

This commit is contained in:
Martijn Cuppens
2020-11-29 15:58:44 +01:00
committed by XhmikosR
parent 5b0dcf8ffe
commit 6c069b6976
2 changed files with 42 additions and 13 deletions

View File

@@ -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, {