diff options
author | Robert Jaros <rjaros@finn.pl> | 2018-02-12 08:04:05 +0100 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2018-02-12 08:04:05 +0100 |
commit | 2feea5e7cf8d492663e826ebcfb0a58e61820352 (patch) | |
tree | 2586cefdd5bf15193158d92b53442608632cd9d9 /src/main/kotlin/pl/treksoft/kvision/modal | |
parent | 4f1a7d4331ec802789009937cda5a1e0e2213cb4 (diff) | |
download | kvision-2feea5e7cf8d492663e826ebcfb0a58e61820352.tar.gz kvision-2feea5e7cf8d492663e826ebcfb0a58e61820352.tar.bz2 kvision-2feea5e7cf8d492663e826ebcfb0a58e61820352.zip |
DSL syntax for containers
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/modal')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt b/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt index 874b4370..f913fac1 100644 --- a/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt +++ b/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt @@ -51,12 +51,13 @@ enum class MODALSIZE(val className: String) { * @param animation determines if animations are used * @param escape determines if dialog can be closed with Esc key * @param classes a set of CSS class names + * @param init an initializer extension function */ @Suppress("TooManyFunctions") open class Modal( caption: String? = null, closeButton: Boolean = true, size: MODALSIZE? = null, animation: Boolean = true, private val escape: Boolean = true, - classes: Set<String> = setOf() + classes: Set<String> = setOf(), init: (Modal.() -> Unit)? = null ) : SimplePanel(classes) { /** @@ -135,6 +136,8 @@ open class Modal( } else { println("At least one Root object is required to create a modal!") } + @Suppress("LeakingThis") + init?.invoke(this) } private fun checkHeaderVisibility() { |