1
0
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:
GeoSot
2021-09-06 10:46:03 +03:00
committed by XhmikosR
parent 3afe4b8c7d
commit 598b4c59a6
4 changed files with 34 additions and 35 deletions

View File

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