diff options
author | Paweł Marks <pmarks@virtuslab.com> | 2020-01-31 13:37:20 +0100 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-01-31 15:07:06 +0100 |
commit | 07e6778ab70122784e0c239c70838adbec66042d (patch) | |
tree | aa0cc980fcc9c75cac7e416093c52a0cea22040a | |
parent | 0e937a192adfb7097ad38e47c10fc6ee83982b6c (diff) | |
download | dokka-07e6778ab70122784e0c239c70838adbec66042d.tar.gz dokka-07e6778ab70122784e0c239c70838adbec66042d.tar.bz2 dokka-07e6778ab70122784e0c239c70838adbec66042d.zip |
Small refactoring of side menu builder in html renderer
className renamed to submenuId
function from unstable package removed
-rw-r--r-- | core/src/main/kotlin/renderers/HtmlRenderer.kt | 7 |
1 files 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") |