diff options
author | Robert Jaros <rjaros@finn.pl> | 2020-05-09 23:53:57 +0200 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2020-05-09 23:53:57 +0200 |
commit | 134cb687c4e05fd81a03b682505f9fb9d741a8d7 (patch) | |
tree | f9f41f28c01dc29d1d4fdd576cc9b21958fd9c3b /src/main/kotlin/pl/treksoft/kvision/html/Ul.kt | |
parent | 4a2aa49e0e561c1bc25aa962449fa2fcce9207ba (diff) | |
download | kvision-134cb687c4e05fd81a03b682505f9fb9d741a8d7.tar.gz kvision-134cb687c4e05fd81a03b682505f9fb9d741a8d7.tar.bz2 kvision-134cb687c4e05fd81a03b682505f9fb9d741a8d7.zip |
Add new className parameter to all DSL builder functions.
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/html/Ul.kt')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/html/Ul.kt | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/html/Ul.kt b/src/main/kotlin/pl/treksoft/kvision/html/Ul.kt index 9673f56d..21e548c8 100644 --- a/src/main/kotlin/pl/treksoft/kvision/html/Ul.kt +++ b/src/main/kotlin/pl/treksoft/kvision/html/Ul.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 *ul*. @@ -51,9 +52,11 @@ open class Ul( */ fun Container.ul( elements: List<String>? = null, rich: Boolean = false, - classes: Set<String> = setOf(), init: (Ul.() -> Unit)? = null + classes: Set<String>? = null, + className: String? = null, + init: (Ul.() -> Unit)? = null ): Ul { - val ul = Ul(elements, rich, classes).apply { init?.invoke(this) } + val ul = Ul(elements, rich, classes ?: className.set).apply { init?.invoke(this) } this.add(ul) return ul } |