aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/dropdown
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2018-10-13 03:37:40 +0200
committerRobert Jaros <rjaros@finn.pl>2018-10-13 03:37:40 +0200
commitebce2c4b839c0b2f8be78bc31c1ce12c45a0164c (patch)
tree7cac3c5449eb8aa398b279d62d9a67ed34fa4115 /src/main/kotlin/pl/treksoft/kvision/dropdown
parent470953c78c2509224bb452c16f8bbea54e53b3d7 (diff)
downloadkvision-ebce2c4b839c0b2f8be78bc31c1ce12c45a0164c.tar.gz
kvision-ebce2c4b839c0b2f8be78bc31c1ce12c45a0164c.tar.bz2
kvision-ebce2c4b839c0b2f8be78bc31c1ce12c45a0164c.zip
Major refactoring of the multi-platform components.
Dependencies upgrade. A lot of code style fixes.
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/dropdown')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt b/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt
index 4ae1e93b..a521fe95 100644
--- a/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt
@@ -61,6 +61,7 @@ enum class DD(val option: String) {
* @param withCaret determines if the dropdown button renders caret
* @param classes a set of CSS class names
*/
+@Suppress("TooManyFunctions")
open class DropDown(
text: String, elements: List<StringPair>? = null, icon: String? = null,
style: ButtonStyle = ButtonStyle.DEFAULT, disabled: Boolean = false, val forNavbar: Boolean = false,
@@ -74,7 +75,7 @@ open class DropDown(
set(value) {
button.text = value
}
- private var elements by refreshOnUpdate(elements, { setChildrenFromElements() })
+ private var elements by refreshOnUpdate(elements) { setChildrenFromElements() }
/**
* The icon of the dropdown button.
*/
@@ -207,18 +208,18 @@ open class DropDown(
@Suppress("UnsafeCastFromDynamic")
override fun afterInsert(node: VNode) {
- this.getElementJQuery()?.on("show.bs.dropdown", { e, _ ->
+ this.getElementJQuery()?.on("show.bs.dropdown") { e, _ ->
this.dispatchEvent("showBsDropdown", obj { detail = e })
- })
- this.getElementJQuery()?.on("shown.bs.dropdown", { e, _ ->
+ }
+ this.getElementJQuery()?.on("shown.bs.dropdown") { e, _ ->
this.dispatchEvent("shownBsDropdown", obj { detail = e })
- })
- this.getElementJQuery()?.on("hide.bs.dropdown", { e, _ ->
+ }
+ this.getElementJQuery()?.on("hide.bs.dropdown") { e, _ ->
this.dispatchEvent("hideBsDropdown", obj { detail = e })
- })
- this.getElementJQuery()?.on("hidden.bs.dropdown", { e, _ ->
+ }
+ this.getElementJQuery()?.on("hidden.bs.dropdown") { e, _ ->
this.dispatchEvent("hiddenBsDropdown", obj { detail = e })
- })
+ }
}
override fun getSnClass(): List<StringBoolPair> {