From 134cb687c4e05fd81a03b682505f9fb9d741a8d7 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Sat, 9 May 2020 23:53:57 +0200 Subject: Add new className parameter to all DSL builder functions. --- src/main/kotlin/pl/treksoft/kvision/html/Section.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main/kotlin/pl/treksoft/kvision/html/Section.kt') diff --git a/src/main/kotlin/pl/treksoft/kvision/html/Section.kt b/src/main/kotlin/pl/treksoft/kvision/html/Section.kt index 43dd8fcf..b880e2fe 100644 --- a/src/main/kotlin/pl/treksoft/kvision/html/Section.kt +++ b/src/main/kotlin/pl/treksoft/kvision/html/Section.kt @@ -22,6 +22,7 @@ package pl.treksoft.kvision.html import pl.treksoft.kvision.core.Container +import pl.treksoft.kvision.utils.set /** * Simple component rendered as *section*. @@ -57,10 +58,11 @@ fun Container.section( content: String? = null, rich: Boolean = false, align: Align? = null, - classes: Set = setOf(), + classes: Set? = null, + className: String? = null, init: (Section.() -> Unit)? = null ): Section { - val section = Section(content, rich, align, classes).apply { init?.invoke(this) } + val section = Section(content, rich, align, classes ?: className.set).apply { init?.invoke(this) } this.add(section) return section } -- cgit