From c40b93a416acd7e5f72ce0025668f1a9d8267fd4 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Sun, 17 Sep 2017 23:34:00 +0200 Subject: Refactoring event handlers --- .../kotlin/pl/treksoft/kvision/snabbdom/Types.kt | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/main/kotlin/pl/treksoft/kvision/snabbdom') diff --git a/src/main/kotlin/pl/treksoft/kvision/snabbdom/Types.kt b/src/main/kotlin/pl/treksoft/kvision/snabbdom/Types.kt index a9ee9442..e8df9971 100644 --- a/src/main/kotlin/pl/treksoft/kvision/snabbdom/Types.kt +++ b/src/main/kotlin/pl/treksoft/kvision/snabbdom/Types.kt @@ -9,8 +9,8 @@ import com.github.snabbdom.VNodeData import com.github.snabbdom.VNodeStyle import org.w3c.dom.CustomEvent import org.w3c.dom.CustomEventInit +import pl.treksoft.jquery.JQueryEventObject import pl.treksoft.kvision.core.Widget -import pl.treksoft.kvision.html.Button external class Object @@ -21,19 +21,19 @@ fun obj(init: dynamic.() -> Unit): dynamic { @Suppress("UnsafeCastFromDynamic") private fun vNodeData(): VNodeData = js("({})") -class DropDownEvent(type: String, eventInitDict: CustomEventInit) : CustomEvent(type, eventInitDict) { - override val detail: Button? = null +class KvEvent(type: String, eventInitDict: CustomEventInit) : CustomEvent(type, eventInitDict) { + override val detail: JQueryEventObject = obj({}) } interface BtOn : On { - var showBsDropdown: ((DropDownEvent) -> kotlin.Unit)? - var shownBsDropdown: ((DropDownEvent) -> kotlin.Unit)? - var hideBsDropdown: ((DropDownEvent) -> kotlin.Unit)? - var hiddenBsDropdown: ((DropDownEvent) -> kotlin.Unit)? - var showBsModal: ((CustomEvent) -> kotlin.Unit)? - var shownBsModal: ((CustomEvent) -> kotlin.Unit)? - var hideBsModal: ((CustomEvent) -> kotlin.Unit)? - var hiddenBsModal: ((CustomEvent) -> kotlin.Unit)? + var showBsDropdown: ((KvEvent) -> kotlin.Unit)? + var shownBsDropdown: ((KvEvent) -> kotlin.Unit)? + var hideBsDropdown: ((KvEvent) -> kotlin.Unit)? + var hiddenBsDropdown: ((KvEvent) -> kotlin.Unit)? + var showBsModal: ((KvEvent) -> kotlin.Unit)? + var shownBsModal: ((KvEvent) -> kotlin.Unit)? + var hideBsModal: ((KvEvent) -> kotlin.Unit)? + var hiddenBsModal: ((KvEvent) -> kotlin.Unit)? } interface SnOn : BtOn { -- cgit