diff options
author | Robert Jaros <rjaros@finn.pl> | 2018-02-12 17:05:16 +0100 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2018-02-12 17:05:16 +0100 |
commit | 2acbcd127e0a512b33cf5d16e0089525b992844c (patch) | |
tree | 108ed647ad741ce5ce86a2376fbd42b0bef71509 /src/main/kotlin | |
parent | 00a6ddf04d61ab322a36123891573c35b41ab58a (diff) | |
download | kvision-2acbcd127e0a512b33cf5d16e0089525b992844c.tar.gz kvision-2acbcd127e0a512b33cf5d16e0089525b992844c.tar.bz2 kvision-2acbcd127e0a512b33cf5d16e0089525b992844c.zip |
Fix of FlexPanel companion object.
Diffstat (limited to 'src/main/kotlin')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/panel/FlexPanel.kt | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/panel/FlexPanel.kt b/src/main/kotlin/pl/treksoft/kvision/panel/FlexPanel.kt index 4a4f4086..e4e5dd47 100644 --- a/src/main/kotlin/pl/treksoft/kvision/panel/FlexPanel.kt +++ b/src/main/kotlin/pl/treksoft/kvision/panel/FlexPanel.kt @@ -244,6 +244,23 @@ open class FlexPanel( } return snstyle } + + companion object { + /** + * DSL builder extension function. + * + * It takes the same parameters as the constructor of the built component. + */ + fun Container.flexPanel( + direction: FLEXDIR? = null, wrap: FLEXWRAP? = null, justify: FLEXJUSTIFY? = null, + alignItems: FLEXALIGNITEMS? = null, alignContent: FLEXALIGNCONTENT? = null, + spacing: Int? = null, classes: Set<String> = setOf(), init: (FlexPanel.() -> Unit)? = null + ): FlexPanel { + val flexPanel = FlexPanel(direction, wrap, justify, alignItems, alignContent, spacing, classes, init) + this.add(flexPanel) + return flexPanel + } + } } /** @@ -275,21 +292,4 @@ internal class FlexWrapper( } return snstyle } - - companion object { - /** - * DSL builder extension function. - * - * It takes the same parameters as the constructor of the built component. - */ - fun Container.flexPanel( - direction: FLEXDIR? = null, wrap: FLEXWRAP? = null, justify: FLEXJUSTIFY? = null, - alignItems: FLEXALIGNITEMS? = null, alignContent: FLEXALIGNCONTENT? = null, - spacing: Int? = null, classes: Set<String> = setOf(), init: (FlexPanel.() -> Unit)? = null - ): FlexPanel { - val flexPanel = FlexPanel(direction, wrap, justify, alignItems, alignContent, spacing, classes, init) - this.add(flexPanel) - return flexPanel - } - } } |