diff options
author | Ignat Beresnev <ignat.beresnev@jetbrains.com> | 2023-02-14 21:30:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-14 21:30:00 +0100 |
commit | daed35f92b3b482688856d139da6849c8e6b4ab1 (patch) | |
tree | 44481e483b217c675afdfc495c850236b9656e98 /plugins/base/src | |
parent | e8423ecf9f430758398eabc0d35077fff17f1f6c (diff) | |
download | dokka-daed35f92b3b482688856d139da6849c8e6b4ab1.tar.gz dokka-daed35f92b3b482688856d139da6849c8e6b4ab1.tar.bz2 dokka-daed35f92b3b482688856d139da6849c8e6b4ab1.zip |
Do not render filter-section for empty source sets (#2858)
Regression from #2848
Diffstat (limited to 'plugins/base/src')
-rw-r--r-- | plugins/base/src/main/kotlin/renderers/html/innerTemplating/DefaultTemplateModelFactory.kt | 5 | ||||
-rw-r--r-- | plugins/base/src/main/resources/dokka/templates/includes/source_set_selector.ftl | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/html/innerTemplating/DefaultTemplateModelFactory.kt b/plugins/base/src/main/kotlin/renderers/html/innerTemplating/DefaultTemplateModelFactory.kt index 3437271a..4fee280e 100644 --- a/plugins/base/src/main/kotlin/renderers/html/innerTemplating/DefaultTemplateModelFactory.kt +++ b/plugins/base/src/main/kotlin/renderers/html/innerTemplating/DefaultTemplateModelFactory.kt @@ -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 } diff --git a/plugins/base/src/main/resources/dokka/templates/includes/source_set_selector.ftl b/plugins/base/src/main/resources/dokka/templates/includes/source_set_selector.ftl index 13650ee5..2d848071 100644 --- a/plugins/base/src/main/resources/dokka/templates/includes/source_set_selector.ftl +++ b/plugins/base/src/main/resources/dokka/templates/includes/source_set_selector.ftl @@ -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>
\ No newline at end of file +</#macro> |