From 2acbcd127e0a512b33cf5d16e0089525b992844c Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Mon, 12 Feb 2018 17:05:16 +0100 Subject: Fix of FlexPanel companion object. --- .../kotlin/pl/treksoft/kvision/panel/FlexPanel.kt | 34 +++++++++++----------- 1 file 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 = 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 = setOf(), init: (FlexPanel.() -> Unit)? = null - ): FlexPanel { - val flexPanel = FlexPanel(direction, wrap, justify, alignItems, alignContent, spacing, classes, init) - this.add(flexPanel) - return flexPanel - } - } } -- cgit