diff options
Diffstat (limited to 'kvision-modules/kvision-bootstrap-datetime/src/main/kotlin/pl/treksoft')
-rw-r--r-- | kvision-modules/kvision-bootstrap-datetime/src/main/kotlin/pl/treksoft/kvision/form/time/DateTimeInput.kt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kvision-modules/kvision-bootstrap-datetime/src/main/kotlin/pl/treksoft/kvision/form/time/DateTimeInput.kt b/kvision-modules/kvision-bootstrap-datetime/src/main/kotlin/pl/treksoft/kvision/form/time/DateTimeInput.kt index 178fbeaa..f9f170a9 100644 --- a/kvision-modules/kvision-bootstrap-datetime/src/main/kotlin/pl/treksoft/kvision/form/time/DateTimeInput.kt +++ b/kvision-modules/kvision-bootstrap-datetime/src/main/kotlin/pl/treksoft/kvision/form/time/DateTimeInput.kt @@ -241,8 +241,7 @@ open class DateTimeInput( override fun afterDestroy() { if (initialized) { - val comp = getElementJQueryD()?.data("DateTimePicker") - if (comp != null) comp.destroy() + getElementJQueryD()?.data("DateTimePicker")?.destroy() initialized = false } } @@ -314,6 +313,7 @@ open class DateTimeInput( private fun initEventHandlers() { this.getElementJQuery()?.on("dp.change") { e, _ -> val moment = e.asDynamic().date + @Suppress("UnsafeCastFromDynamic") if (moment) { this.value = moment.toDate() } else { |