diff options
author | Robert Jaros <rjaros@finn.pl> | 2018-01-17 19:29:30 +0100 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2018-01-17 19:29:30 +0100 |
commit | 31c9d3c4121107974a8419752aa7face5c96f821 (patch) | |
tree | 77aaac10c5a120b028c14f53ab74eb5491f4a443 /src/main/kotlin/pl/treksoft/kvision/modal | |
parent | 646e82e383850447fd4d10f71ecc0aeab11623e0 (diff) | |
download | kvision-31c9d3c4121107974a8419752aa7face5c96f821.tar.gz kvision-31c9d3c4121107974a8419752aa7face5c96f821.tar.bz2 kvision-31c9d3c4121107974a8419752aa7face5c96f821.zip |
Code formatting (Kotlin Style Guide)
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/modal')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/modal/Alert.kt | 16 | ||||
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/modal/Confirm.kt | 22 | ||||
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt | 8 |
3 files changed, 28 insertions, 18 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/modal/Alert.kt b/src/main/kotlin/pl/treksoft/kvision/modal/Alert.kt index 39268ffa..5b8932cb 100644 --- a/src/main/kotlin/pl/treksoft/kvision/modal/Alert.kt +++ b/src/main/kotlin/pl/treksoft/kvision/modal/Alert.kt @@ -7,9 +7,11 @@ import pl.treksoft.kvision.html.Button import pl.treksoft.kvision.html.TAG import pl.treksoft.kvision.html.Tag -open class Alert(caption: String? = null, text: String? = null, rich: Boolean = false, - align: ALIGN? = null, size: MODALSIZE? = null, animation: Boolean = true, - private val callback: (() -> Unit)? = null) : Modal(caption, true, size, animation) { +open class Alert( + caption: String? = null, text: String? = null, rich: Boolean = false, + align: ALIGN? = null, size: MODALSIZE? = null, animation: Boolean = true, + private val callback: (() -> Unit)? = null +) : Modal(caption, true, size, animation) { var text get() = content.text set(value) { @@ -47,9 +49,11 @@ open class Alert(caption: String? = null, text: String? = null, rich: Boolean = companion object { @Suppress("LongParameterList") - fun show(caption: String? = null, text: String? = null, rich: Boolean = false, - align: ALIGN? = null, size: MODALSIZE? = null, animation: Boolean = true, - callback: (() -> Unit)? = null) { + fun show( + caption: String? = null, text: String? = null, rich: Boolean = false, + align: ALIGN? = null, size: MODALSIZE? = null, animation: Boolean = true, + callback: (() -> Unit)? = null + ) { Alert(caption, text, rich, align, size, animation, callback).show() } } diff --git a/src/main/kotlin/pl/treksoft/kvision/modal/Confirm.kt b/src/main/kotlin/pl/treksoft/kvision/modal/Confirm.kt index 90766854..05550f34 100644 --- a/src/main/kotlin/pl/treksoft/kvision/modal/Confirm.kt +++ b/src/main/kotlin/pl/treksoft/kvision/modal/Confirm.kt @@ -6,11 +6,13 @@ import pl.treksoft.kvision.html.Button import pl.treksoft.kvision.html.TAG import pl.treksoft.kvision.html.Tag -open class Confirm(caption: String? = null, text: String? = null, rich: Boolean = false, - align: ALIGN? = null, size: MODALSIZE? = null, animation: Boolean = true, - cancelVisible: Boolean = false, - private val noCallback: (() -> Unit)? = null, - private val yesCallback: (() -> Unit)? = null) : Modal(caption, false, size, animation, false) { +open class Confirm( + caption: String? = null, text: String? = null, rich: Boolean = false, + align: ALIGN? = null, size: MODALSIZE? = null, animation: Boolean = true, + cancelVisible: Boolean = false, + private val noCallback: (() -> Unit)? = null, + private val yesCallback: (() -> Unit)? = null +) : Modal(caption, false, size, animation, false) { var text get() = content.text set(value) { @@ -74,10 +76,12 @@ open class Confirm(caption: String? = null, text: String? = null, rich: Boolean companion object { @Suppress("LongParameterList") - fun show(caption: String? = null, text: String? = null, rich: Boolean = false, - align: ALIGN? = null, size: MODALSIZE? = null, animation: Boolean = true, - cancelVisible: Boolean = false, - noCallback: (() -> Unit)? = null, yesCallback: (() -> Unit)? = null) { + fun show( + caption: String? = null, text: String? = null, rich: Boolean = false, + align: ALIGN? = null, size: MODALSIZE? = null, animation: Boolean = true, + cancelVisible: Boolean = false, + noCallback: (() -> Unit)? = null, yesCallback: (() -> Unit)? = null + ) { Confirm(caption, text, rich, align, size, animation, cancelVisible, noCallback, yesCallback).show() } } diff --git a/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt b/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt index 08d56f4c..2c83077a 100644 --- a/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt +++ b/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt @@ -19,9 +19,11 @@ enum class MODALSIZE(val className: String) { } @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()) : SimplePanel(classes) { +open class Modal( + caption: String? = null, closeButton: Boolean = true, + size: MODALSIZE? = null, animation: Boolean = true, private val escape: Boolean = true, + classes: Set<String> = setOf() +) : SimplePanel(classes) { private var caption get() = captionTag.text set(value) { |