summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2018-02-23 11:06:35 +0100
committerRobert Jaros <rjaros@finn.pl>2018-02-23 11:06:35 +0100
commitaf5f3f3ed2d60c5d77fd4a04bf7520f0c3408a26 (patch)
tree932da0136ceb73eaf735307923e912c19b7629dd
parente4520cdc2761ee8c03c44949dbfdd710cb9af619 (diff)
downloadkvision-af5f3f3ed2d60c5d77fd4a04bf7520f0c3408a26.tar.gz
kvision-af5f3f3ed2d60c5d77fd4a04bf7520f0c3408a26.tar.bz2
kvision-af5f3f3ed2d60c5d77fd4a04bf7520f0c3408a26.zip
Removed DOM artifacts left after destroying DateTimeInput.
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/core/Widget.kt3
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/time/DateTimeInput.kt4
2 files changed, 6 insertions, 1 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt b/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt
index a746ffa4..8e66d130 100644
--- a/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt
@@ -289,8 +289,9 @@ open class Widget(classes: Set<String> = setOf()) : StyledComponent() {
}
}
destroy = { _ ->
- vnode = null
afterDestroy()
+ vnode = null
+ vnode
}
}
return hooks
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/time/DateTimeInput.kt b/src/main/kotlin/pl/treksoft/kvision/form/time/DateTimeInput.kt
index 3eeec789..6004b320 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/time/DateTimeInput.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/time/DateTimeInput.kt
@@ -215,6 +215,10 @@ open class DateTimeInput(
}
}
+ override fun afterDestroy() {
+ getElementJQueryD()?.datetimepicker("remove")
+ }
+
private fun initDateTimePicker() {
val datePickerFormat = format.toDatePickerFormat()
val minView = if (format.contains("HH") || format.contains("mm")) 0 else 2