aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/modal
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/modal')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/modal/Alert.kt4
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/modal/Confirm.kt4
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/modal/Alert.kt b/src/main/kotlin/pl/treksoft/kvision/modal/Alert.kt
index c04449c2..39268ffa 100644
--- a/src/main/kotlin/pl/treksoft/kvision/modal/Alert.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/modal/Alert.kt
@@ -8,7 +8,7 @@ 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 = ALIGN.NONE, size: MODALSIZE? = null, animation: Boolean = true,
+ align: ALIGN? = null, size: MODALSIZE? = null, animation: Boolean = true,
private val callback: (() -> Unit)? = null) : Modal(caption, true, size, animation) {
var text
get() = content.text
@@ -48,7 +48,7 @@ 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 = ALIGN.NONE, size: MODALSIZE? = null, animation: Boolean = true,
+ 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 aa4e8b88..90766854 100644
--- a/src/main/kotlin/pl/treksoft/kvision/modal/Confirm.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/modal/Confirm.kt
@@ -7,7 +7,7 @@ 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 = ALIGN.NONE, size: MODALSIZE? = null, animation: Boolean = true,
+ 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) {
@@ -75,7 +75,7 @@ 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 = ALIGN.NONE, size: MODALSIZE? = null, animation: Boolean = true,
+ 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 69a83dfb..94796326 100644
--- a/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt
@@ -180,8 +180,8 @@ open class ModalDialog(size: MODALSIZE?) : Container(setOf("modal-dialog")) {
override fun getSnClass(): List<StringBoolPair> {
val cl = super.getSnClass().toMutableList()
- if (size != null) {
- cl.add(size?.className.orEmpty() to true)
+ size?.let {
+ cl.add(it.className to true)
}
return cl
}