aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/panel
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2020-02-26 13:30:23 +0100
committerRobert Jaros <rjaros@finn.pl>2020-02-26 13:30:23 +0100
commit99dcb8e434d7e0ccf5dada379c1b03e894e6aa82 (patch)
tree25e6a9d47fdbddfc2af2d97eae35e1dba8d44490 /src/main/kotlin/pl/treksoft/kvision/panel
parent9a8525f2e5cb50071c076032fdcef5a48060108e (diff)
downloadkvision-99dcb8e434d7e0ccf5dada379c1b03e894e6aa82.tar.gz
kvision-99dcb8e434d7e0ccf5dada379c1b03e894e6aa82.tar.bz2
kvision-99dcb8e434d7e0ccf5dada379c1b03e894e6aa82.zip
Major changes in the event handling architecture. Support for multiple event handlers.
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/panel')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/panel/Root.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/panel/Root.kt b/src/main/kotlin/pl/treksoft/kvision/panel/Root.kt
index b1bb36a8..4b02db5a 100644
--- a/src/main/kotlin/pl/treksoft/kvision/panel/Root.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/panel/Root.kt
@@ -29,6 +29,7 @@ import pl.treksoft.kvision.KVManager
import pl.treksoft.kvision.core.StringBoolPair
import pl.treksoft.kvision.core.Style
import pl.treksoft.kvision.core.Widget
+import pl.treksoft.kvision.core.onEvent
import pl.treksoft.kvision.utils.snClasses
import pl.treksoft.kvision.utils.snOpt
import kotlin.browser.document
@@ -103,7 +104,7 @@ class Root : SimplePanel {
fun addContextMenu(contextMenu: Widget) {
contextMenus.add(contextMenu)
contextMenu.parent = this
- this.setInternalEventListener<Root> {
+ this.onEvent {
click = { e ->
@Suppress("UnsafeCastFromDynamic")
if (!e.asDynamic().dropDownCM) contextMenu.hide()