aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/panel/VPanel.kt
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2018-02-12 08:04:05 +0100
committerRobert Jaros <rjaros@finn.pl>2018-02-12 08:04:05 +0100
commit2feea5e7cf8d492663e826ebcfb0a58e61820352 (patch)
tree2586cefdd5bf15193158d92b53442608632cd9d9 /src/main/kotlin/pl/treksoft/kvision/panel/VPanel.kt
parent4f1a7d4331ec802789009937cda5a1e0e2213cb4 (diff)
downloadkvision-2feea5e7cf8d492663e826ebcfb0a58e61820352.tar.gz
kvision-2feea5e7cf8d492663e826ebcfb0a58e61820352.tar.bz2
kvision-2feea5e7cf8d492663e826ebcfb0a58e61820352.zip
DSL syntax for containers
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/panel/VPanel.kt')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/panel/VPanel.kt11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/panel/VPanel.kt b/src/main/kotlin/pl/treksoft/kvision/panel/VPanel.kt
index 91ee4a6a..823ab66f 100644
--- a/src/main/kotlin/pl/treksoft/kvision/panel/VPanel.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/panel/VPanel.kt
@@ -31,11 +31,18 @@ package pl.treksoft.kvision.panel
* @param alignItems flexbox items alignment
* @param spacing spacing between columns/rows
* @param classes a set of CSS class names
+ * @param init an initializer extension function
*/
open class VPanel(
justify: FLEXJUSTIFY? = null, alignItems: FLEXALIGNITEMS? = null, spacing: Int? = null,
- classes: Set<String> = setOf()
+ classes: Set<String> = setOf(), init: (VPanel.() -> Unit)? = null
) : FlexPanel(
FLEXDIR.COLUMN,
null, justify, alignItems, null, spacing, classes
-)
+) {
+ init {
+ @Suppress("LeakingThis")
+ init?.invoke(this)
+ }
+}
+