From 07e6778ab70122784e0c239c70838adbec66042d Mon Sep 17 00:00:00 2001 From: Paweł Marks Date: Fri, 31 Jan 2020 13:37:20 +0100 Subject: Small refactoring of side menu builder in html renderer className renamed to submenuId function from unstable package removed --- core/src/main/kotlin/renderers/HtmlRenderer.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core/src/main/kotlin/renderers/HtmlRenderer.kt b/core/src/main/kotlin/renderers/HtmlRenderer.kt index af99d349..901c25f5 100644 --- a/core/src/main/kotlin/renderers/HtmlRenderer.kt +++ b/core/src/main/kotlin/renderers/HtmlRenderer.kt @@ -5,7 +5,6 @@ import kotlinx.html.stream.createHTML import org.jetbrains.dokka.model.Function import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext -import org.jetbrains.kotlin.utils.addToStdlib.ifNotEmpty import java.io.File open class HtmlRenderer( @@ -20,12 +19,12 @@ open class HtmlRenderer( private fun FlowContent.buildSideMenu(context: PageNode, node: PageNode) { val children = node.children.filter { it !is MemberPageNode } - val className = children.ifNotEmpty { "nav$idCounter" } + val submenuId = if (children.isNotEmpty()) "nav$idCounter" else null div("sideMenuPart") { - className?.let { id = it } + submenuId?.also { id = it } div("overview") { buildLink(node, context) - className?.let { + submenuId?.also { span("navButton") { onClick = """document.getElementById("$it").classList.toggle("hidden");""" span("navButtonContent") -- cgit