mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-14 18:42:30 +03:00
Use for...of in visual tests too
This commit is contained in:
+18
-18
@@ -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