aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2018-03-11 23:45:44 +0100
committerRobert Jaros <rjaros@finn.pl>2018-03-11 23:45:44 +0100
commit8af92325f5c0981e7678136a8f12590373ad9e2f (patch)
tree4b542329794a17f92bc22892b02a76cefd22490a /src/main/kotlin/pl
parentc0fca9901a634d53d8ee0bfb119b9b2e2f017d83 (diff)
downloadkvision-8af92325f5c0981e7678136a8f12590373ad9e2f.tar.gz
kvision-8af92325f5c0981e7678136a8f12590373ad9e2f.tar.bz2
kvision-8af92325f5c0981e7678136a8f12590373ad9e2f.zip
Small fix for rich text component.
Diffstat (limited to 'src/main/kotlin/pl')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt b/src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt
index 4ab0a59b..4c3d09a5 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt
@@ -82,8 +82,10 @@ open class RichTextInput(value: String? = null, classes: Set<String> = setOf())
}
this.getElementJQuery()?.on("trix-initialize", { _, _ ->
trixId = this.getElementJQuery()?.attr("trix-id")
- value?.let {
- this.getElement().asDynamic().editor.loadHTML(it)
+ if (trixId!=null) {
+ value?.let {
+ this.getElement().asDynamic().editor.loadHTML(it)
+ }
}
})
this.getElementJQuery()?.on("trix-file-accept", { e, _ -> e.preventDefault() })