From 45a1954740b27a710c7aedd03192aa3c95f435f6 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Sun, 5 May 2019 17:10:33 +0200 Subject: [PATCH] fix progress bar animation, remove forEach not needed currently --- .../docs/4.3/assets/js/src/application.js | 17 ++++++++--------- 1 file 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 66b1d09eb0..dfbced4136 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 = '
'