diff options
author | Robert Jaros <rjaros@finn.pl> | 2017-09-17 23:34:00 +0200 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2017-09-17 23:34:00 +0200 |
commit | c40b93a416acd7e5f72ce0025668f1a9d8267fd4 (patch) | |
tree | 63e018b9789be0dc6ac0ed215fc3c25359455eb8 /src/main/kotlin/pl/treksoft/kvision/modal | |
parent | 9a8a42e60947083352eed78a8fea5f92ea5a9a4e (diff) | |
download | kvision-c40b93a416acd7e5f72ce0025668f1a9d8267fd4.tar.gz kvision-c40b93a416acd7e5f72ce0025668f1a9d8267fd4.tar.bz2 kvision-c40b93a416acd7e5f72ce0025668f1a9d8267fd4.zip |
Refactoring event handlers
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/modal')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt b/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt index 0b11d45f..1a0bce1a 100644 --- a/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt +++ b/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt @@ -132,21 +132,21 @@ open class Modal(caption: String? = null, closeButton: Boolean = true, keyboard = escape backdrop = if (escape) "true" else "static" }) - this.getElementJQuery()?.on("show.bs.modal", { _, _ -> - val event = CustomEvent("showBsModal") + this.getElementJQuery()?.on("show.bs.modal", { e, _ -> + val event = CustomEvent("showBsModal", obj({ detail = e })) this.getElement()?.dispatchEvent(event) }) - this.getElementJQuery()?.on("shown.bs.modal", { _, _ -> - val event = CustomEvent("shownBsModal") + this.getElementJQuery()?.on("shown.bs.modal", { e, _ -> + val event = CustomEvent("shownBsModal", obj({ detail = e })) this.getElement()?.dispatchEvent(event) }) - this.getElementJQuery()?.on("hide.bs.modal", { _, _ -> - val event = CustomEvent("hideBsModal") + this.getElementJQuery()?.on("hide.bs.modal", { e, _ -> + val event = CustomEvent("hideBsModal", obj({ detail = e })) this.getElement()?.dispatchEvent(event) }) - this.getElementJQuery()?.on("hidden.bs.modal", { _, _ -> + this.getElementJQuery()?.on("hidden.bs.modal", { e, _ -> this.visible = false - val event = CustomEvent("hiddenBsModal") + val event = CustomEvent("hiddenBsModal", obj({ detail = e })) this.getElement()?.dispatchEvent(event) }) } |