From 4a7952db63e9bcb0cfc8683327cc772b6e9706d2 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Fri, 15 Sep 2017 13:14:46 +0200 Subject: Turn off toggle of disabled dropdown --- src/main/kotlin/pl/treksoft/kvision/Showcase.kt | 1 + src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/kotlin/pl/treksoft') diff --git a/src/main/kotlin/pl/treksoft/kvision/Showcase.kt b/src/main/kotlin/pl/treksoft/kvision/Showcase.kt index 9ab1ac0e..258e870d 100644 --- a/src/main/kotlin/pl/treksoft/kvision/Showcase.kt +++ b/src/main/kotlin/pl/treksoft/kvision/Showcase.kt @@ -79,6 +79,7 @@ class Showcase : ApplicationBase() { println(self.text) dd3.text = "Zmiana" dd3.style = BUTTONSTYLE.WARNING + dd3.disabled = true } } root.add(button) diff --git a/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt b/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt index f2784e5a..7ee9a28f 100644 --- a/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt +++ b/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt @@ -81,7 +81,7 @@ open class DropDown(text: String, elements: List? = null, icon: Stri init { button.setEventListener { click = { - toggle() + if (!button.disabled) toggle() } } -- cgit