Skip to content

Commit b781420

Browse files
author
ngiraud
committed
Fix bug with dots in the carousel + add titles on dots for accessibility.
1 parent 6d7c9c5 commit b781420

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

templates/html_report/index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
</div>
7575
</div>
7676
<div class="icon-container">
77-
<span class="dot dot-first active"></span>
78-
<span class="dot dot-second"></span>
77+
<span class="dot dot-first active" title="Maintainability / complexity"></span>
78+
<span class="dot dot-second" title="Maintainability without comments / complexity"></span>
7979
</div>
8080
</div>
8181
</div>

templates/html_report/js/graph-carousel.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,24 @@
4646
for (var i = 0; i < slides.length; i += 1) {
4747
slides[i].setAttribute('style', 'transform:translateX(-' + carouselCount + '%)');
4848
}
49-
activeDot(e.target || e.srcElement);
49+
activeDot();
5050
}
5151

52-
function activeDot(target)
52+
function activeDot()
5353
{
5454
for (var i = 0; i < dots.length; i++) {
5555
dots[i].classList.remove('active')
5656
}
57-
target.classList.add('active');
57+
switch (carouselCount) {
58+
case 0:
59+
dots[0].classList.add('active');
60+
break;
61+
case 100:
62+
dots[1].classList.add('active');
63+
break;
64+
default:
65+
break;
66+
}
5867
}
5968

6069
// create new Event to dispatch click for auto scroll

templates/html_report/panel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ class="number"><?php echo $avg->lcom ?></div>
130130
</div>
131131
</div>
132132
<div class="icon-container">
133-
<span class="dot dot-first active"></span>
134-
<span class="dot dot-second"></span>
133+
<span class="dot dot-first active" title="Maintainability / complexity"></span>
134+
<span class="dot dot-second" title="Maintainability without comments / complexity"></span>
135135
</div>
136136
</div>
137137
</div>

0 commit comments

Comments
 (0)