aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/form/spinner
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2018-03-08 11:28:01 +0100
committerRobert Jaros <rjaros@finn.pl>2018-03-08 11:28:01 +0100
commit19906e0305e054c1d951705335a61d41949565f4 (patch)
tree2d892436af252abca86ea6dd267681d371b2e1d7 /src/main/kotlin/pl/treksoft/kvision/form/spinner
parent09d81e12fd4a41132cb711c282e98425dc1334cf (diff)
downloadkvision-19906e0305e054c1d951705335a61d41949565f4.tar.gz
kvision-19906e0305e054c1d951705335a61d41949565f4.tar.bz2
kvision-19906e0305e054c1d951705335a61d41949565f4.zip
Add focus() and blur() methods to all FormControls.
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/form/spinner')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/spinner/Spinner.kt8
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/spinner/SpinnerInput.kt14
2 files changed, 22 insertions, 0 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/spinner/Spinner.kt b/src/main/kotlin/pl/treksoft/kvision/form/spinner/Spinner.kt
index c96bae26..0aa514b7 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/spinner/Spinner.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/spinner/Spinner.kt
@@ -236,6 +236,14 @@ open class Spinner(
return this
}
+ override fun focus() {
+ input.focus()
+ }
+
+ override fun blur() {
+ input.blur()
+ }
+
companion object {
internal var counter = 0
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/spinner/SpinnerInput.kt b/src/main/kotlin/pl/treksoft/kvision/form/spinner/SpinnerInput.kt
index a0da7999..b9903ff8 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/spinner/SpinnerInput.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/spinner/SpinnerInput.kt
@@ -281,6 +281,20 @@ open class SpinnerInput(
}
}
+ /**
+ * Makes the input element focused.
+ */
+ open fun focus() {
+ getElementJQuery()?.focus()
+ }
+
+ /**
+ * Makes the input element blur.
+ */
+ open fun blur() {
+ getElementJQuery()?.blur()
+ }
+
companion object {
internal var counter = 0