aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/modal
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2018-02-22 12:43:43 +0100
committerRobert Jaros <rjaros@finn.pl>2018-02-22 12:43:43 +0100
commite40c13c62de806169368adc7c2c4212f7df6413b (patch)
tree250e39d407cd2c6ef19c9a8ea0176a3215a4a818 /src/main/kotlin/pl/treksoft/kvision/modal
parent1aefed336f9ef305f59d3668abc8a39c550e921d (diff)
downloadkvision-e40c13c62de806169368adc7c2c4212f7df6413b.tar.gz
kvision-e40c13c62de806169368adc7c2c4212f7df6413b.tar.bz2
kvision-e40c13c62de806169368adc7c2c4212f7df6413b.zip
Property values delegated to a map (idea by tieskedh)
Closes #2
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/modal')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/modal/Confirm.kt6
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt12
2 files changed, 3 insertions, 15 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/modal/Confirm.kt b/src/main/kotlin/pl/treksoft/kvision/modal/Confirm.kt
index 33512a7e..a3bb8d77 100644
--- a/src/main/kotlin/pl/treksoft/kvision/modal/Confirm.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/modal/Confirm.kt
@@ -75,11 +75,7 @@ open class Confirm(
/**
* Determines if Cancel button is visible.
*/
- var cancelVisible = cancelVisible
- set(value) {
- field = value
- refreshCancelButton()
- }
+ var cancelVisible by refreshOnUpdate(cancelVisible, { refreshCancelButton() })
private val content = Tag(TAG.DIV, text, rich, align)
private val cancelButton = Button("Cancel", "remove")
diff --git a/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt b/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt
index f913fac1..d9cd0e8e 100644
--- a/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt
@@ -89,11 +89,7 @@ open class Modal(
/**
* Determines if animations are used.
*/
- var animation = animation
- set(value) {
- field = value
- refresh()
- }
+ var animation by refreshOnUpdate(animation)
private val dialog = ModalDialog(size)
private val header = SimplePanel(setOf("modal-header"))
@@ -260,11 +256,7 @@ internal class ModalDialog(size: MODALSIZE?) : SimplePanel(setOf("modal-dialog")
/**
* Modal window size.
*/
- var size = size
- set(value) {
- field = value
- refresh()
- }
+ var size by refreshOnUpdate(size)
override fun getSnClass(): List<StringBoolPair> {
val cl = super.getSnClass().toMutableList()