aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-bootstrap/src/main/kotlin/pl/treksoft/kvision/modal
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-11-15 09:07:05 +0100
committerRobert Jaros <rjaros@finn.pl>2019-11-15 09:07:05 +0100
commit77bf290155cbfa6d389c4937bf2a5a34dd5b33bd (patch)
treee558ab18360da4d1685dc204ae661c4357842e41 /kvision-modules/kvision-bootstrap/src/main/kotlin/pl/treksoft/kvision/modal
parent822ee9a8d0efd5bcacacd7dc5c1c35b549ed9c34 (diff)
downloadkvision-77bf290155cbfa6d389c4937bf2a5a34dd5b33bd.tar.gz
kvision-77bf290155cbfa6d389c4937bf2a5a34dd5b33bd.tar.bz2
kvision-77bf290155cbfa6d389c4937bf2a5a34dd5b33bd.zip
Fix an issue with high CPU utilization in IntelliJ by introducing new onEvent extension function and changing the names of some style methods
Diffstat (limited to 'kvision-modules/kvision-bootstrap/src/main/kotlin/pl/treksoft/kvision/modal')
-rw-r--r--kvision-modules/kvision-bootstrap/src/main/kotlin/pl/treksoft/kvision/modal/Alert.kt4
-rw-r--r--kvision-modules/kvision-bootstrap/src/main/kotlin/pl/treksoft/kvision/modal/Confirm.kt6
-rw-r--r--kvision-modules/kvision-bootstrap/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt2
3 files changed, 6 insertions, 6 deletions
diff --git a/kvision-modules/kvision-bootstrap/src/main/kotlin/pl/treksoft/kvision/modal/Alert.kt b/kvision-modules/kvision-bootstrap/src/main/kotlin/pl/treksoft/kvision/modal/Alert.kt
index 4c5b222e..852820af 100644
--- a/kvision-modules/kvision-bootstrap/src/main/kotlin/pl/treksoft/kvision/modal/Alert.kt
+++ b/kvision-modules/kvision-bootstrap/src/main/kotlin/pl/treksoft/kvision/modal/Alert.kt
@@ -77,13 +77,13 @@ open class Alert(
init {
body.add(contentTag)
val okButton = Button("OK", "fas fa-check", ButtonStyle.PRIMARY)
- okButton.setEventListener {
+ okButton.setEventListener<Button> {
click = {
hide()
}
}
this.addButton(okButton)
- this.setEventListener {
+ this.setEventListener<Button> {
keydown = { e ->
if (e.keyCode == ENTER_KEY) {
hide()
diff --git a/kvision-modules/kvision-bootstrap/src/main/kotlin/pl/treksoft/kvision/modal/Confirm.kt b/kvision-modules/kvision-bootstrap/src/main/kotlin/pl/treksoft/kvision/modal/Confirm.kt
index 058ca7bc..c464ea11 100644
--- a/kvision-modules/kvision-bootstrap/src/main/kotlin/pl/treksoft/kvision/modal/Confirm.kt
+++ b/kvision-modules/kvision-bootstrap/src/main/kotlin/pl/treksoft/kvision/modal/Confirm.kt
@@ -114,20 +114,20 @@ open class Confirm(
init {
body.add(contentTag)
- cancelButton.setEventListener {
+ cancelButton.setEventListener<Button> {
click = {
hide()
}
}
this.addButton(cancelButton)
- noButton.setEventListener {
+ noButton.setEventListener<Button> {
click = {
hide()
noCallback?.invoke()
}
}
this.addButton(noButton)
- yesButton.setEventListener {
+ yesButton.setEventListener<Button> {
click = {
hide()
yesCallback?.invoke()
diff --git a/kvision-modules/kvision-bootstrap/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt b/kvision-modules/kvision-bootstrap/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt
index b064e30c..63035e76 100644
--- a/kvision-modules/kvision-bootstrap/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt
+++ b/kvision-modules/kvision-bootstrap/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt
@@ -120,7 +120,7 @@ open class Modal(
dialog.role = "document"
dialog.add(content)
closeIcon.visible = closeButton
- closeIcon.setEventListener {
+ closeIcon.setEventListener<CloseIcon> {
click = {
hide()
}