diff options
author | Robert Jaros <rjaros@finn.pl> | 2020-02-26 23:12:48 +0100 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2020-02-26 23:12:48 +0100 |
commit | 450d3d259cd3253f7cda8ab4baffb0a6d070d596 (patch) | |
tree | 25ff42e5e9e7d683ce5395fdd7159ed85244b1a3 /src/main/kotlin/pl/treksoft/kvision/utils | |
parent | 94f36f212a60654571728a1f34701d95453efc22 (diff) | |
download | kvision-450d3d259cd3253f7cda8ab4baffb0a6d070d596.tar.gz kvision-450d3d259cd3253f7cda8ab4baffb0a6d070d596.tar.bz2 kvision-450d3d259cd3253f7cda8ab4baffb0a6d070d596.zip |
Major changes in the event handling architecture. Support for multiple event handlers.
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/utils')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/utils/Snabbdom.kt | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/utils/Snabbdom.kt b/src/main/kotlin/pl/treksoft/kvision/utils/Snabbdom.kt index 00d7e59a..768ce8aa 100644 --- a/src/main/kotlin/pl/treksoft/kvision/utils/Snabbdom.kt +++ b/src/main/kotlin/pl/treksoft/kvision/utils/Snabbdom.kt @@ -157,12 +157,21 @@ inline fun snOpt(noinline block: VNodeData.() -> Unit) = (vNodeData()::apply)(bl * Internal function. */ @Suppress("UnsafeCastFromDynamic") -internal fun on(widget: Widget): SnOn<Widget> { +internal fun on(target: Widget): SnOn<Widget> { val obj = js("{}") - obj["self"] = widget + obj["self"] = target return obj } +/** + * @suppress + * Internal function. + */ +@Suppress("UnsafeCastFromDynamic") +internal fun emptyOn(): SnOn<Widget> { + return js("{}") +} + @Suppress("UnsafeCastFromDynamic", "NOTHING_TO_INLINE") internal inline fun hooks(): Hooks { return js("{}") |