diff options
| author | Robert Jaros <rjaros@finn.pl> | 2018-02-25 01:04:24 +0100 |
|---|---|---|
| committer | Robert Jaros <rjaros@finn.pl> | 2018-02-25 01:04:24 +0100 |
| commit | 9a1effcf29b27cc2e60b927c2d737b6cad0289b7 (patch) | |
| tree | cd47309106493f869a7d7d5e9a43dcc99969dd4c /src/main/kotlin/pl/treksoft/kvision/form/select | |
| parent | c64b2c4b1f0c4e0e0d94d202715db4aaa47d9c65 (diff) | |
| download | kvision-9a1effcf29b27cc2e60b927c2d737b6cad0289b7.tar.gz kvision-9a1effcf29b27cc2e60b927c2d737b6cad0289b7.tar.bz2 kvision-9a1effcf29b27cc2e60b927c2d737b6cad0289b7.zip | |
Change enum classes names for better readability.
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/form/select')
| -rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/form/select/AjaxOptions.kt | 8 | ||||
| -rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/form/select/SelectInput.kt | 16 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/select/AjaxOptions.kt b/src/main/kotlin/pl/treksoft/kvision/form/select/AjaxOptions.kt index 7fc91ddc..09d2fcdb 100644 --- a/src/main/kotlin/pl/treksoft/kvision/form/select/AjaxOptions.kt +++ b/src/main/kotlin/pl/treksoft/kvision/form/select/AjaxOptions.kt @@ -29,7 +29,7 @@ import pl.treksoft.kvision.utils.obj /** * HTTP protocol type for the AJAX call. */ -enum class HTTPTYPE(internal val type: String) { +enum class HttpType(internal val type: String) { GET("GET"), POST("POST") } @@ -37,7 +37,7 @@ enum class HTTPTYPE(internal val type: String) { /** * Data type for the AJAX call. */ -enum class DATATYPE(internal val type: String) { +enum class DataType(internal val type: String) { JSON("json"), JSONP("jsonp"), XML("xml"), @@ -77,8 +77,8 @@ enum class DATATYPE(internal val type: String) { */ data class AjaxOptions( val url: String, val preprocessData: (dynamic) -> dynamic, val beforeSend: ((JQueryXHR) -> dynamic)? = null, - val data: dynamic = null, val httpType: HTTPTYPE = HTTPTYPE.GET, - val dataType: DATATYPE = DATATYPE.JSON, val minLength: Int = 0, + val data: dynamic = null, val httpType: HttpType = HttpType.GET, + val dataType: DataType = DataType.JSON, val minLength: Int = 0, val cache: Boolean = true, val clearOnEmpty: Boolean = true, val clearOnError: Boolean = true, val emptyRequest: Boolean = false, val requestDelay: Int = AJAX_REQUEST_DELAY, val restoreOnError: Boolean = false diff --git a/src/main/kotlin/pl/treksoft/kvision/form/select/SelectInput.kt b/src/main/kotlin/pl/treksoft/kvision/form/select/SelectInput.kt index dd8fcabd..e94d7e2f 100644 --- a/src/main/kotlin/pl/treksoft/kvision/form/select/SelectInput.kt +++ b/src/main/kotlin/pl/treksoft/kvision/form/select/SelectInput.kt @@ -28,8 +28,8 @@ import pl.treksoft.kvision.core.Container import pl.treksoft.kvision.core.CssSize import pl.treksoft.kvision.core.StringBoolPair import pl.treksoft.kvision.core.StringPair -import pl.treksoft.kvision.form.INPUTSIZE -import pl.treksoft.kvision.html.BUTTONSTYLE +import pl.treksoft.kvision.form.InputSize +import pl.treksoft.kvision.html.ButtonStyle import pl.treksoft.kvision.panel.SimplePanel import pl.treksoft.kvision.utils.asString import pl.treksoft.kvision.utils.obj @@ -37,7 +37,7 @@ import pl.treksoft.kvision.utils.obj /** * Select width types. See [Bootstrap Select width](http://silviomoreto.github.io/bootstrap-select/examples/#width). */ -enum class SELECTWIDTHTYPE(internal val value: String) { +enum class SelectWidthType(internal val value: String) { AUTO("auto"), FIT("fit") } @@ -102,7 +102,7 @@ open class SelectInput( /** * The style of the select control. */ - var style: BUTTONSTYLE? by refreshOnUpdate() + var style: ButtonStyle? by refreshOnUpdate() /** * The width of the select control. */ @@ -110,7 +110,7 @@ open class SelectInput( /** * The width type of the select control. */ - var selectWidthType: SELECTWIDTHTYPE? by refreshOnUpdate() + var selectWidthType: SelectWidthType? by refreshOnUpdate() /** * Determines if an empty option is automatically generated. */ @@ -126,7 +126,7 @@ open class SelectInput( /** * The size of the input. */ - var size: INPUTSIZE? by refreshOnUpdate() + var size: InputSize? by refreshOnUpdate() init { setChildrenFromOptions() @@ -266,10 +266,10 @@ open class SelectInput( } val btnStyle = style?.className ?: "btn-default" when (size) { - INPUTSIZE.LARGE -> { + InputSize.LARGE -> { sn.add("data-style" to "$btnStyle btn-lg") } - INPUTSIZE.SMALL -> { + InputSize.SMALL -> { sn.add("data-style" to "$btnStyle btn-sm") } else -> { |
