Skip to content

Commit 410b25c

Browse files
committed
style: apply formatting to js file
1 parent 094f282 commit 410b25c

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

static/js/banner.js

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,35 @@ let currImgIndex = -1;
22
let timerCarousel;
33
let carouselImgs;
44

5-
65
function advanceCarousel() {
7-
carouselImgs[currImgIndex].style.display = "none";
8-
currImgIndex = ++currImgIndex % carouselImgs.length;
9-
carouselImgs[currImgIndex].style.display = "block";
6+
carouselImgs[currImgIndex].style.display = "none";
7+
currImgIndex = ++currImgIndex % carouselImgs.length;
8+
carouselImgs[currImgIndex].style.display = "block";
109
}
1110

1211
function onClickHandlerAdvance() {
13-
clearInterval(timerCarousel);
14-
advanceCarousel();
15-
timerCarousel = setInterval(advanceCarousel, BANNER_TIMEOUT);
12+
clearInterval(timerCarousel);
13+
advanceCarousel();
14+
timerCarousel = setInterval(advanceCarousel, BANNER_TIMEOUT);
1615
}
1716

1817
(function setupCarousel() {
19-
carouselImgs = document.getElementsByClassName(IMGS_CLASS);
20-
if (carouselImgs.length <= 0) { // To prevent call back on pages with no images
21-
console.log("No Images found with class: " + IMGS_CLASS);
22-
return; // Do nothing no images found
23-
}
18+
carouselImgs = document.getElementsByClassName(IMGS_CLASS);
19+
if (carouselImgs.length <= 0) { // To prevent call back on pages with no images
20+
console.log("No Images found with class: " + IMGS_CLASS);
21+
return; // Do nothing no images found
22+
}
2423

25-
// Hide all images
26-
for (let i = 0; i < carouselImgs.length; i++) {
27-
carouselImgs[i].style.display = "none";
28-
}
24+
// Hide all images
25+
for (let i = 0; i < carouselImgs.length; i++) {
26+
carouselImgs[i].style.display = "none";
27+
}
2928

30-
currImgIndex = carouselImgs.length - 1; // Initialize last image
31-
timerCarousel = setInterval(advanceCarousel, BANNER_TIMEOUT);
32-
advanceCarousel();
29+
currImgIndex = carouselImgs.length - 1; // Initialize last image
30+
timerCarousel = setInterval(advanceCarousel, BANNER_TIMEOUT);
31+
advanceCarousel();
3332

34-
// Set onclick handler to advance photo
35-
let container = document.getElementById(IMGS_CONTAINER_ID);
36-
container.onclick = onClickHandlerAdvance;
37-
})();
33+
// Set onclick handler to advance photo
34+
let container = document.getElementById(IMGS_CONTAINER_ID);
35+
container.onclick = onClickHandlerAdvance;
36+
})();

0 commit comments

Comments
 (0)