Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / themes / seven / js / mobile.install.js
1 /**
2 * DO NOT EDIT THIS FILE.
3 * See the following change record for more information,
4 * https://www.drupal.org/node/2815083
5 * @preserve
6 **/
7
8 (function () {
9   function findActiveStep(steps) {
10     for (var i = 0; i < steps.length; i++) {
11       if (steps[i].className === 'is-active') {
12         return i + 1;
13       }
14     }
15
16     if (steps[steps.length - 1].className === 'done') {
17       return steps.length;
18     }
19     return 0;
20   }
21
22   function installStepsSetup() {
23     var steps = document.querySelectorAll('.task-list li');
24     if (steps.length) {
25       var header = document.querySelector('header[role="banner"]');
26       var stepIndicator = document.createElement('div');
27       stepIndicator.className = 'step-indicator';
28       stepIndicator.innerHTML = findActiveStep(steps) + '/' + steps.length;
29       header.appendChild(stepIndicator);
30     }
31   }
32
33   if (document.addEventListener) {
34     document.addEventListener('DOMContentLoaded', installStepsSetup);
35   }
36 })();