diff options
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/panel/SimplePanel.kt')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/panel/SimplePanel.kt | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/panel/SimplePanel.kt b/src/main/kotlin/pl/treksoft/kvision/panel/SimplePanel.kt index 91eeda80..915fa6a7 100644 --- a/src/main/kotlin/pl/treksoft/kvision/panel/SimplePanel.kt +++ b/src/main/kotlin/pl/treksoft/kvision/panel/SimplePanel.kt @@ -101,17 +101,15 @@ open class SimplePanel(classes: Set<String> = setOf(), init: (SimplePanel.() -> children.forEach { it.dispose() } removeAll() } +} - companion object { - /** - * DSL builder extension function. - * - * It takes the same parameters as the constructor of the built component. - */ - fun Container.simplePanel(classes: Set<String> = setOf(), init: (SimplePanel.() -> Unit)? = null): SimplePanel { - val simplePanel = SimplePanel(classes, init) - this.add(simplePanel) - return simplePanel - } - } +/** + * DSL builder extension function. + * + * It takes the same parameters as the constructor of the built component. + */ +fun Container.simplePanel(classes: Set<String> = setOf(), init: (SimplePanel.() -> Unit)? = null): SimplePanel { + val simplePanel = SimplePanel(classes, init) + this.add(simplePanel) + return simplePanel } |