Skip to content

Commit

Permalink
Do not render filter-section for empty source sets (#2858)
Browse files Browse the repository at this point in the history
Regression from #2848
  • Loading branch information
IgnatBeresnev authored Feb 14, 2023
1 parent e8423ec commit daed35f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ class DefaultTemplateModelFactory(val context: DokkaContext) : TemplateModelFact
.sortedBy { it.comparableKey }
.map { SourceSetModel(it.name, it.platform.key, it.sourceSetIDs.merged.toString()) }
.toList()
mapper["sourceSets"] = sourceSets

if (sourceSets.isNotEmpty()) {
mapper["sourceSets"] = sourceSets
}
}
return mapper
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<#macro display>
<#if sourceSets??>
<#if sourceSets?has_content>
<div class="filter-section" id="filter-section">
<#list sourceSets as ss>
<button class="platform-tag platform-selector ${ss.platform}-like" data-active="" data-filter="${ss.filter}">${ss.name}</button>
</#list>
</div>
</#if>
</#macro>
</#macro>

0 comments on commit daed35f

Please sign in to comment.