diff options
author | Robert Jaros <rjaros@finn.pl> | 2018-03-11 23:45:44 +0100 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2018-03-11 23:45:44 +0100 |
commit | 8af92325f5c0981e7678136a8f12590373ad9e2f (patch) | |
tree | 4b542329794a17f92bc22892b02a76cefd22490a /src/main/kotlin/pl/treksoft/kvision | |
parent | c0fca9901a634d53d8ee0bfb119b9b2e2f017d83 (diff) | |
download | kvision-8af92325f5c0981e7678136a8f12590373ad9e2f.tar.gz kvision-8af92325f5c0981e7678136a8f12590373ad9e2f.tar.bz2 kvision-8af92325f5c0981e7678136a8f12590373ad9e2f.zip |
Small fix for rich text component.
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt | 6 |
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() }) |