From c78775aa2aaf76f9fa1404ff32a10fb8227f380e Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Fri, 25 Oct 2019 20:46:42 +0200 Subject: Style fixes --- .../src/main/kotlin/pl/treksoft/kvision/form/time/DateTimeInput.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'kvision-modules/kvision-bootstrap-datetime') 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 { -- cgit