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 /kvision-modules/kvision-richtext | |
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 'kvision-modules/kvision-richtext')
-rw-r--r-- | kvision-modules/kvision-richtext/src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/kvision-modules/kvision-richtext/src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt b/kvision-modules/kvision-richtext/src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt index 8b58e272..fc7957ca 100644 --- a/kvision-modules/kvision-richtext/src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt +++ b/kvision-modules/kvision-richtext/src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt @@ -25,6 +25,7 @@ import com.github.snabbdom.VNode import pl.treksoft.jquery.jQuery import pl.treksoft.kvision.core.Container import pl.treksoft.kvision.core.StringPair +import pl.treksoft.kvision.utils.set import kotlin.browser.document /** @@ -122,9 +123,12 @@ open class RichTextInput(value: String? = null, classes: Set<String> = setOf()) * It takes the same parameters as the constructor of the built component. */ fun Container.richTextInput( - value: String? = null, classes: Set<String> = setOf(), init: (RichTextInput.() -> Unit)? = null + value: String? = null, + classes: Set<String>? = null, + className: String? = null, + init: (RichTextInput.() -> Unit)? = null ): RichTextInput { - val richTextInput = RichTextInput(value, classes).apply { init?.invoke(this) } + val richTextInput = RichTextInput(value, classes ?: className.set).apply { init?.invoke(this) } this.add(richTextInput) return richTextInput } |