Skip to content

Commit

Permalink
Add active class for anchor tag in HTML report
Browse files Browse the repository at this point in the history
  • Loading branch information
takahirom committed Feb 18, 2024
1 parent 948928b commit 6471149
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ data class CaptureResults(
"<div class=\"col s12\">\n" +
"<ul class=\"tabs\">"
)
tabs.forEach { tab ->
tabs.forEachIndexed { tabIndex, tab ->
// <li class="tab col s3"><a href="#test1">Test 1</a></li>
append("""<li class="tab col s3"><a href="#${tab.id}">${tab.title}</a></li>""")
val activeClass = if (tabIndex == 0) """class="active" """ else ""
append("""<li class="tab col s3"><a $activeClass href="#${tab.id}">${tab.title}</a></li>""")
}
append("</ul>\n</div>")
tabs.forEach { tab ->
Expand Down

0 comments on commit 6471149

Please sign in to comment.