1
0
Fork 0
mirror of https://github.com/twbs/bootstrap.git synced 2022-11-09 12:25:43 -05:00

fix progress bar animation, remove forEach not needed currently

This commit is contained in:
Johann-S 2019-05-05 17:10:33 +02:00
parent f5599d0a04
commit 45a1954740

View file

@ -83,16 +83,15 @@
}
// Activate animated progress bar
makeArray(document.querySelectorAll('.bd-toggle-animated-progress > .progress-bar-striped'))
.forEach(function (progressBar) {
progressBar.addEventListener('click', function () {
if (progressBar.classList.contains('progress-bar-animated')) {
progressBar.classList.remove('progress-bar-animated')
} else {
progressBar.classList.add('progress-bar-animated')
var btnToggleAnimatedProgress = document.querySelector('.bd-toggle-animated-progress')
if (btnToggleAnimatedProgress) {
btnToggleAnimatedProgress.addEventListener('click', function () {
btnToggleAnimatedProgress.parentNode
.querySelector('.progress-bar-striped')
.classList
.toggle('progress-bar-animated')
})
}
})
})
// Insert copy to clipboard button before .highlight
var btnHtml = '<div class="bd-clipboard"><button type="button" class="btn-clipboard" title="Copy to clipboard">Copy</button></div>'