diff options
author | Robert Jaros <rjaros@finn.pl> | 2017-09-09 22:17:34 +0200 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2017-09-09 22:17:34 +0200 |
commit | 037c9c22bfe23064b2e110225261a26247649967 (patch) | |
tree | 53ab791f98500a9921372c027cef6db02c48aff5 /src/main/kotlin/pl/treksoft/kvision/snabbdom | |
parent | 85b48891c61c604c952c8739b50bdae2998c44a7 (diff) | |
download | kvision-037c9c22bfe23064b2e110225261a26247649967.tar.gz kvision-037c9c22bfe23064b2e110225261a26247649967.tar.bz2 kvision-037c9c22bfe23064b2e110225261a26247649967.zip |
Integrate jQuery mappings
Globally disabled Data API
Added support for dropdown events
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/snabbdom')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/snabbdom/Types.kt | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/snabbdom/Types.kt b/src/main/kotlin/pl/treksoft/kvision/snabbdom/Types.kt index 3bf68003..8a292910 100644 --- a/src/main/kotlin/pl/treksoft/kvision/snabbdom/Types.kt +++ b/src/main/kotlin/pl/treksoft/kvision/snabbdom/Types.kt @@ -2,11 +2,15 @@ package pl.treksoft.kvision.snabbdom import com.github.snabbdom.Attrs import com.github.snabbdom.Classes +import com.github.snabbdom.Hooks import com.github.snabbdom.On import com.github.snabbdom.Props import com.github.snabbdom.VNodeData import com.github.snabbdom.VNodeStyle +import org.w3c.dom.CustomEvent +import org.w3c.dom.CustomEventInit import pl.treksoft.kvision.core.Widget +import pl.treksoft.kvision.html.Button external class Object @@ -17,7 +21,18 @@ fun obj(init: dynamic.() -> Unit): dynamic { @Suppress("UnsafeCastFromDynamic") private fun vNodeData(): VNodeData = js("({})") -interface SnOn<T> : On { +class DropDownEvent(type: String, eventInitDict: CustomEventInit) : CustomEvent(type, eventInitDict) { + override val detail: Button? = null +} + +interface BtOn : On { + var showBsDropdown: ((DropDownEvent) -> kotlin.Unit)? + var shownBsDropdown: ((DropDownEvent) -> kotlin.Unit)? + var hideBsDropdown: ((DropDownEvent) -> kotlin.Unit)? + var hiddenBsDropdown: ((DropDownEvent) -> kotlin.Unit)? +} + +interface SnOn<T> : BtOn { var self: T } @@ -30,6 +45,11 @@ internal fun on(widget: Widget): SnOn<Widget> { return obj } +@Suppress("UnsafeCastFromDynamic") +internal fun hooks(): Hooks { + return js("({})") +} + typealias StringPair = Pair<String, String> typealias StringBoolPair = Pair<String, Boolean> |