diff options
author | Robert Jaros <rjaros@finn.pl> | 2018-10-13 03:37:40 +0200 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2018-10-13 03:37:40 +0200 |
commit | ebce2c4b839c0b2f8be78bc31c1ce12c45a0164c (patch) | |
tree | 7cac3c5449eb8aa398b279d62d9a67ed34fa4115 /kvision-modules/kvision-select/src/main/kotlin/pl/treksoft | |
parent | 470953c78c2509224bb452c16f8bbea54e53b3d7 (diff) | |
download | kvision-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 'kvision-modules/kvision-select/src/main/kotlin/pl/treksoft')
3 files changed, 23 insertions, 23 deletions
diff --git a/kvision-modules/kvision-select/src/main/kotlin/pl/treksoft/kvision/KVManagerSelect.kt b/kvision-modules/kvision-select/src/main/kotlin/pl/treksoft/kvision/KVManagerSelect.kt index c7c3815a..e2c556c1 100644 --- a/kvision-modules/kvision-select/src/main/kotlin/pl/treksoft/kvision/KVManagerSelect.kt +++ b/kvision-modules/kvision-select/src/main/kotlin/pl/treksoft/kvision/KVManagerSelect.kt @@ -21,7 +21,7 @@ */ package pl.treksoft.kvision -internal val KVManagerSelectInit = KVManagerSelect.init() +internal val kVManagerSelectInit = KVManagerSelect.init() /** * Internal singleton object which initializes and configures KVision select module. diff --git a/kvision-modules/kvision-select/src/main/kotlin/pl/treksoft/kvision/form/select/SelectInput.kt b/kvision-modules/kvision-select/src/main/kotlin/pl/treksoft/kvision/form/select/SelectInput.kt index 8f4569c7..30609907 100644 --- a/kvision-modules/kvision-select/src/main/kotlin/pl/treksoft/kvision/form/select/SelectInput.kt +++ b/kvision-modules/kvision-select/src/main/kotlin/pl/treksoft/kvision/form/select/SelectInput.kt @@ -66,11 +66,11 @@ open class SelectInput( /** * A list of options (label to value pairs) for the select control. */ - internal var options by refreshOnUpdate(options, { setChildrenFromOptions() }) + internal var options by refreshOnUpdate(options) { setChildrenFromOptions() } /** * A value of the selected option. */ - var value by refreshOnUpdate(value, { refreshState() }) + var value by refreshOnUpdate(value) { refreshState() } /** * The name attribute of the generated HTML select element. */ @@ -82,12 +82,12 @@ open class SelectInput( /** * Additional options for remote (AJAX) data source. */ - var ajaxOptions by refreshOnUpdate(ajaxOptions, { + var ajaxOptions by refreshOnUpdate(ajaxOptions) { if (it != null) { liveSearch = true } refresh() - }) + } /** * Maximal number of selected options. */ @@ -115,7 +115,7 @@ open class SelectInput( /** * Determines if an empty option is automatically generated. */ - var emptyOption by refreshOnUpdate(false, { setChildrenFromOptions() }) + var emptyOption by refreshOnUpdate(false) { setChildrenFromOptions() } /** * Determines if the field is disabled. */ @@ -291,31 +291,31 @@ open class SelectInput( getElementJQueryD()?.selectpicker("render").ajaxSelectPicker(it.toJs(emptyOption)) } ?: getElementJQueryD()?.selectpicker("render") - this.getElementJQuery()?.on("show.bs.select", { e, _ -> + this.getElementJQuery()?.on("show.bs.select") { e, _ -> this.dispatchEvent("showBsSelect", obj { detail = e }) - }) - this.getElementJQuery()?.on("shown.bs.select", { e, _ -> + } + this.getElementJQuery()?.on("shown.bs.select") { e, _ -> this.dispatchEvent("shownBsSelect", obj { detail = e }) - }) - this.getElementJQuery()?.on("hide.bs.select", { e, _ -> + } + this.getElementJQuery()?.on("hide.bs.select") { e, _ -> this.dispatchEvent("hideBsSelect", obj { detail = e }) - }) - this.getElementJQuery()?.on("hidden.bs.select", { e, _ -> + } + this.getElementJQuery()?.on("hidden.bs.select") { e, _ -> this.dispatchEvent("hiddenBsSelect", obj { detail = e }) - }) - this.getElementJQuery()?.on("loaded.bs.select", { e, _ -> + } + this.getElementJQuery()?.on("loaded.bs.select") { e, _ -> this.dispatchEvent("loadedBsSelect", obj { detail = e }) - }) - this.getElementJQuery()?.on("rendered.bs.select", { e, _ -> + } + this.getElementJQuery()?.on("rendered.bs.select") { e, _ -> this.dispatchEvent("renderedBsSelect", obj { detail = e }) - }) - this.getElementJQuery()?.on("refreshed.bs.select", { e, _ -> + } + this.getElementJQuery()?.on("refreshed.bs.select") { e, _ -> this.dispatchEvent("refreshedBsSelect", obj { detail = e }) - }) - this.getElementJQueryD()?.on("changed.bs.select", { e, cIndex: Int -> + } + this.getElementJQueryD()?.on("changed.bs.select") { e, cIndex: Int -> e["clickedIndex"] = cIndex this.dispatchEvent("changedBsSelect", obj { detail = e }) - }) + } refreshState() } diff --git a/kvision-modules/kvision-select/src/main/kotlin/pl/treksoft/kvision/form/select/SelectOptGroup.kt b/kvision-modules/kvision-select/src/main/kotlin/pl/treksoft/kvision/form/select/SelectOptGroup.kt index e33b3457..d90f0e6d 100644 --- a/kvision-modules/kvision-select/src/main/kotlin/pl/treksoft/kvision/form/select/SelectOptGroup.kt +++ b/kvision-modules/kvision-select/src/main/kotlin/pl/treksoft/kvision/form/select/SelectOptGroup.kt @@ -49,7 +49,7 @@ open class SelectOptGroup( /** * A list of options (label to value pairs) for the group. */ - var options by refreshOnUpdate(options, { setChildrenFromOptions() }) + var options by refreshOnUpdate(options) { setChildrenFromOptions() } /** * Maximal number of selected options in the group. */ |