Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / themes / seven / js / mobile.install.es6.js
1 (function() {
2   function findActiveStep(steps) {
3     for (let i = 0; i < steps.length; i++) {
4       if (steps[i].className === 'is-active') {
5         return i + 1;
6       }
7     }
8     // The final "Finished" step is never "active".
9     if (steps[steps.length - 1].className === 'done') {
10       return steps.length;
11     }
12     return 0;
13   }
14
15   function installStepsSetup() {
16     const steps = document.querySelectorAll('.task-list li');
17     if (steps.length) {
18       const header = document.querySelector('header[role="banner"]');
19       const stepIndicator = document.createElement('div');
20       stepIndicator.className = 'step-indicator';
21       stepIndicator.innerHTML = `${findActiveStep(steps)}/${steps.length}`;
22       header.appendChild(stepIndicator);
23     }
24   }
25
26   if (document.addEventListener) {
27     document.addEventListener('DOMContentLoaded', installStepsSetup);
28   }
29 })();