mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-30 00:29:52 +02:00
Use for...of
in visual tests too
This commit is contained in:
@@ -57,26 +57,26 @@
|
||||
<script src="../../dist/toast.js"></script>
|
||||
<script>
|
||||
window.addEventListener('load', function () {
|
||||
Array.from(document.querySelectorAll('.toast'))
|
||||
.forEach(function (toastNode) {
|
||||
new Toast(toastNode)
|
||||
})
|
||||
var toastElements = document.querySelectorAll('.toast')
|
||||
for (const toastEl of toastElements) {
|
||||
new Toast(toastEl)
|
||||
}
|
||||
|
||||
document.getElementById('btnShowToast').addEventListener('click', function () {
|
||||
Array.from(document.querySelectorAll('.toast'))
|
||||
.forEach(function (toastNode) {
|
||||
var toast = Toast.getInstance(toastNode)
|
||||
toast.show()
|
||||
})
|
||||
})
|
||||
document.getElementById('btnShowToast').addEventListener('click', function () {
|
||||
var toastElements = document.querySelectorAll('.toast')
|
||||
for (const toastEl of toastElements) {
|
||||
var toast = Toast.getInstance(toastEl)
|
||||
toast.show()
|
||||
}
|
||||
})
|
||||
|
||||
document.getElementById('btnHideToast').addEventListener('click', function () {
|
||||
Array.from(document.querySelectorAll('.toast'))
|
||||
.forEach(function (toastNode) {
|
||||
var toast = Toast.getInstance(toastNode)
|
||||
toast.hide()
|
||||
})
|
||||
})
|
||||
document.getElementById('btnHideToast').addEventListener('click', function () {
|
||||
var toastElements = document.querySelectorAll('.toast')
|
||||
for (const toastEl of toastElements) {
|
||||
var toast = Toast.getInstance(toastEl)
|
||||
toast.hide()
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
Reference in New Issue
Block a user