aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/dropdown
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/dropdown
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/dropdown')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt b/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt
index 0f653d30..1370f25a 100644
--- a/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt
@@ -70,11 +70,7 @@ open class DropDown(
set(value) {
button.text = value
}
- private var elements = elements
- set(value) {
- field = value
- setChildrenFromElements()
- }
+ private var elements by refreshOnUpdate(elements, { setChildrenFromElements() })
/**
* The icon of the dropdown button.
*/
@@ -126,11 +122,7 @@ open class DropDown(
/**
* Determines if the dropdown is showing upwards.
*/
- var dropup = false
- set(value) {
- field = value
- refresh()
- }
+ var dropup by refreshOnUpdate(false)
/**
* Width of the dropdown button.
*/