MCPcopy
hub / github.com/jdan/cleaver / updateProgress

Function updateProgress

resources/script.js:47–56  ·  view source on GitHub ↗

* Sets the progress indicator.

()

Source from the content-addressed store, hash-verified

45 * Sets the progress indicator.
46 */
47function updateProgress() {
48 var progressBar = document.querySelector('.progress-bar');
49
50 if (progressBar !== null) {
51 var numSlides = document.getElementsByClassName('slide').length;
52 var position = currentPosition() - 1;
53 var percent = (numSlides === 1) ? 100 : 100 * position / (numSlides - 1);
54 progressBar.style.width = percent.toString() + '%';
55 }
56}
57
58
59/**

Callers 1

navigateFunction · 0.85

Calls 1

currentPositionFunction · 0.85

Tested by

no test coverage detected