diff options
author | Robert Jaros <rjaros@finn.pl> | 2018-10-13 03:37:40 +0200 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2018-10-13 03:37:40 +0200 |
commit | ebce2c4b839c0b2f8be78bc31c1ce12c45a0164c (patch) | |
tree | 7cac3c5449eb8aa398b279d62d9a67ed34fa4115 /kvision-modules/kvision-richtext | |
parent | 470953c78c2509224bb452c16f8bbea54e53b3d7 (diff) | |
download | kvision-ebce2c4b839c0b2f8be78bc31c1ce12c45a0164c.tar.gz kvision-ebce2c4b839c0b2f8be78bc31c1ce12c45a0164c.tar.bz2 kvision-ebce2c4b839c0b2f8be78bc31c1ce12c45a0164c.zip |
Major refactoring of the multi-platform components.
Dependencies upgrade.
A lot of code style fixes.
Diffstat (limited to 'kvision-modules/kvision-richtext')
2 files changed, 6 insertions, 7 deletions
diff --git a/kvision-modules/kvision-richtext/src/main/kotlin/pl/treksoft/kvision/KVManagerRichText.kt b/kvision-modules/kvision-richtext/src/main/kotlin/pl/treksoft/kvision/KVManagerRichText.kt index 1ccd7a85..c7cd444c 100644 --- a/kvision-modules/kvision-richtext/src/main/kotlin/pl/treksoft/kvision/KVManagerRichText.kt +++ b/kvision-modules/kvision-richtext/src/main/kotlin/pl/treksoft/kvision/KVManagerRichText.kt @@ -25,7 +25,7 @@ import pl.treksoft.kvision.i18n.I18n import pl.treksoft.kvision.utils.obj import kotlin.browser.window -internal val KVManagerRichTextInit = KVManagerRichText.init() +internal val kVManagerRichTextInit = KVManagerRichText.init() /** * Internal singleton object which initializes and configures KVision RichText module. diff --git a/kvision-modules/kvision-richtext/src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt b/kvision-modules/kvision-richtext/src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt index 961c27cd..43b018f4 100644 --- a/kvision-modules/kvision-richtext/src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt +++ b/kvision-modules/kvision-richtext/src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt @@ -23,7 +23,6 @@ package pl.treksoft.kvision.form.text import com.github.snabbdom.VNode import pl.treksoft.jquery.jQuery -import pl.treksoft.kvision.KVManagerRichText import pl.treksoft.kvision.core.Container import pl.treksoft.kvision.core.StringPair import kotlin.browser.document @@ -67,7 +66,7 @@ open class RichTextInput(value: String? = null, classes: Set<String> = setOf()) if (this.disabled || this.readonly == true) { this.getElementJQuery()?.removeAttr("contenteditable") } else { - this.getElementJQuery()?.on("trix-change", { _, _ -> + this.getElementJQuery()?.on("trix-change") { _, _ -> if (trixId != null) { val v = document.getElementById("trix-input-$trixId")?.let { jQuery(it).`val`() as String? } value = if (v != null && v.isNotEmpty()) { @@ -78,9 +77,9 @@ open class RichTextInput(value: String? = null, classes: Set<String> = setOf()) val event = org.w3c.dom.events.Event("change") this.getElement()?.dispatchEvent(event) } - }) + } } - this.getElementJQuery()?.on("trix-initialize", { _, _ -> + this.getElementJQuery()?.on("trix-initialize") { _, _ -> trixId = this.getElementJQuery()?.attr("trix-id") if (trixId != null) { value?.let { @@ -89,8 +88,8 @@ open class RichTextInput(value: String? = null, classes: Set<String> = setOf()) } } } - }) - this.getElementJQuery()?.on("trix-file-accept", { e, _ -> e.preventDefault() }) + } + this.getElementJQuery()?.on("trix-file-accept") { e, _ -> e.preventDefault() } } override fun afterDestroy() { |