diff options
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/dropdown')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt b/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt index 8cc7eaf6..780cc4e3 100644 --- a/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt +++ b/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt @@ -134,21 +134,17 @@ open class DropDown(text: String, elements: List<StringPair>? = null, icon: Stri @Suppress("UnsafeCastFromDynamic") override fun afterInsert(node: VNode) { this.getElementJQuery()?.on("show.bs.dropdown", { e, _ -> - val event = CustomEvent("showBsDropdown", obj({ detail = e })) - this.getElement()?.dispatchEvent(event) + this.dispatchEvent("showBsDropdown", obj({ detail = e })) }) this.getElementJQuery()?.on("shown.bs.dropdown", { e, _ -> - val event = CustomEvent("shownBsDropdown", obj({ detail = e })) - this.getElement()?.dispatchEvent(event) + this.dispatchEvent("shownBsDropdown", obj({ detail = e })) }) this.getElementJQuery()?.on("hide.bs.dropdown", { e, _ -> - val event = CustomEvent("hideBsDropdown", obj({ detail = e })) - this.getElement()?.dispatchEvent(event) + this.dispatchEvent("hideBsDropdown", obj({ detail = e })) }) this.getElementJQuery()?.on("hidden.bs.dropdown", { e, _ -> list.visible = false - val event = CustomEvent("hiddenBsDropdown", obj({ detail = e })) - this.getElement()?.dispatchEvent(event) + this.dispatchEvent("hiddenBsDropdown", obj({ detail = e })) }) } |