aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/Showcase.kt
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2017-09-17 23:34:00 +0200
committerRobert Jaros <rjaros@finn.pl>2017-09-17 23:34:00 +0200
commitc40b93a416acd7e5f72ce0025668f1a9d8267fd4 (patch)
tree63e018b9789be0dc6ac0ed215fc3c25359455eb8 /src/main/kotlin/pl/treksoft/kvision/Showcase.kt
parent9a8a42e60947083352eed78a8fea5f92ea5a9a4e (diff)
downloadkvision-c40b93a416acd7e5f72ce0025668f1a9d8267fd4.tar.gz
kvision-c40b93a416acd7e5f72ce0025668f1a9d8267fd4.tar.bz2
kvision-c40b93a416acd7e5f72ce0025668f1a9d8267fd4.zip
Refactoring event handlers
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/Showcase.kt')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/Showcase.kt15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/Showcase.kt b/src/main/kotlin/pl/treksoft/kvision/Showcase.kt
index 1e93d95a..3bccdfb1 100644
--- a/src/main/kotlin/pl/treksoft/kvision/Showcase.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/Showcase.kt
@@ -36,10 +36,13 @@ 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) }
+ dd.setEventListener<DropDown> {
+ showBsDropdown = { e -> println("show" + (e.detail)) }
shownBsDropdown = { e -> println("shown" + e.detail) }
- hideBsDropdown = { e -> println("hide" + e.detail) }
+ hideBsDropdown = { e ->
+ println("hide" + e.detail)
+ e.detail.preventDefault()
+ }
hiddenBsDropdown = { e -> println("hidden" + e.detail) }
}
@@ -47,7 +50,7 @@ class Showcase : ApplicationBase() {
"Header" to HEADER.POS, "Separtatorek" to SEPARATOR.POS
), "flag", dropup = true)
root.add(dd2)
- dd2.setEventListener<Button> {
+ dd2.setEventListener<DropDown> {
hideBsDropdown = { e -> println("hide" + e.detail) }
hiddenBsDropdown = { e -> println("hidden" + e.detail) }
}
@@ -82,7 +85,9 @@ class Showcase : ApplicationBase() {
modal.add(Tag(TAG.H4, "ABC"))
modal.add(Image(Img("kotlin.png")))
modal.addButton(Button("To jest button"))
-
+/* modal.setEventListener<Modal> {
+ hideBsModal = { e -> e.detail.preventDefault() }
+ }*/
val button = Button("To jest przycisk FA", "fa-flag", BUTTONSTYLE.DANGER)
button.setEventListener<Button> {
click = { _ ->