aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann-S <[email protected]>2019-05-05 17:10:33 +0200
committerJohann-S <[email protected]>2019-05-05 17:45:39 +0200
commit45a1954740b27a710c7aedd03192aa3c95f435f6 (patch)
treeaff12ac6b98a6cd1cbceffd19f1bf395a6490589
parentf5599d0a04a8f691e961a2f9e462917556974b20 (diff)
downloadbootstrap-45a1954740b27a710c7aedd03192aa3c95f435f6.tar.xz
bootstrap-45a1954740b27a710c7aedd03192aa3c95f435f6.zip
fix progress bar animation, remove forEach not needed currently
-rw-r--r--site/static/docs/4.3/assets/js/src/application.js17
1 files changed, 8 insertions, 9 deletions
diff --git a/site/static/docs/4.3/assets/js/src/application.js b/site/static/docs/4.3/assets/js/src/application.js
index 66b1d09eb..dfbced413 100644
--- a/site/static/docs/4.3/assets/js/src/application.js
+++ b/site/static/docs/4.3/assets/js/src/application.js
@@ -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>'