aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/Showcase.kt
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2017-09-09 22:17:34 +0200
committerRobert Jaros <rjaros@finn.pl>2017-09-09 22:17:34 +0200
commit037c9c22bfe23064b2e110225261a26247649967 (patch)
tree53ab791f98500a9921372c027cef6db02c48aff5 /src/main/kotlin/pl/treksoft/kvision/Showcase.kt
parent85b48891c61c604c952c8739b50bdae2998c44a7 (diff)
downloadkvision-037c9c22bfe23064b2e110225261a26247649967.tar.gz
kvision-037c9c22bfe23064b2e110225261a26247649967.tar.bz2
kvision-037c9c22bfe23064b2e110225261a26247649967.zip
Integrate jQuery mappings
Globally disabled Data API Added support for dropdown events
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/Showcase.kt')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/Showcase.kt16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/Showcase.kt b/src/main/kotlin/pl/treksoft/kvision/Showcase.kt
index b2e6d764..6275fe88 100644
--- a/src/main/kotlin/pl/treksoft/kvision/Showcase.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/Showcase.kt
@@ -3,7 +3,6 @@ package pl.treksoft.kvision
import pl.treksoft.kvision.basic.Label
import pl.treksoft.kvision.core.Container
import pl.treksoft.kvision.core.Img
-import pl.treksoft.kvision.core.KVManager
import pl.treksoft.kvision.core.Root
import pl.treksoft.kvision.dropdown.DD.*
import pl.treksoft.kvision.dropdown.DropDown
@@ -32,11 +31,21 @@ class Showcase : ApplicationBase() {
val dd = DropDown("Dropdown", listOf("abc" to "#!/x", "def" to "#!/y"), "flag")
root.add(dd)
+ dd.setEventListener<Button> {
+ showBsDropdown = { e -> println("show" + (e.detail)?.text) }
+ shownBsDropdown = { e -> println("shown" + e.detail) }
+ hideBsDropdown = { e -> println("hide" + e.detail) }
+ hiddenBsDropdown = { e -> println("hidden" + e.detail) }
+ }
val dd2 = DropDown("Dropdown2", listOf("abc" to "#!/abc", "def" to "#!/def", "xyz" to DISABLED.POS,
"Header" to HEADER.POS, "Separtatorek" to SEPARATOR.POS
), "flag", dropup = true)
root.add(dd2)
+ dd2.setEventListener<Button> {
+ hideBsDropdown = { e -> println("hide" + e.detail) }
+ hiddenBsDropdown = { e -> println("hidden" + e.detail) }
+ }
val p = Tag(TAG.P, "To jest prawo", align = ALIGN.RIGHT)
p.title = "Tytuł"
@@ -65,6 +74,7 @@ class Showcase : ApplicationBase() {
val button2 = Button("To jest przycisk", "flag", BUTTONSTYLE.DANGER)
button2.setEventListener {
click = { e ->
+ dd.hide()
println("2" + e)
button.setEventListener {
click = null
@@ -75,6 +85,7 @@ class Showcase : ApplicationBase() {
val button3 = Button("To jest przycisk IMG", image = Img("kotlin.png"))
button3.setEventListener {
click = { e ->
+ dd.show()
println("3" + e)
button.setEventListener<Button> {
click = { _ -> println(self.text) }
@@ -90,6 +101,8 @@ class Showcase : ApplicationBase() {
.on("/test", { -> println("test") })
.resolve()
+// jQuery(document).off(".data-api")
+
// routing.on(RegExp("/abc/def/(.*)/(.*)/(.*)"), { x,y,z,u,v -> println(x) })
// router.on("/test", { -> println("test") })
@@ -113,7 +126,6 @@ class Showcase : ApplicationBase() {
}
override fun dispose(): Map<String, Any> {
- KVManager.shutdown()
return mapOf<String, Any>()
}
}