From ebce2c4b839c0b2f8be78bc31c1ce12c45a0164c Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Sat, 13 Oct 2018 03:37:40 +0200 Subject: Major refactoring of the multi-platform components. Dependencies upgrade. A lot of code style fixes. --- .../src/main/kotlin/pl/treksoft/kvision/KVManagerRichText.kt | 2 +- .../kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'kvision-modules/kvision-richtext/src/main/kotlin/pl/treksoft') 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 = 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 = 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 = setOf()) } } } - }) - this.getElementJQuery()?.on("trix-file-accept", { e, _ -> e.preventDefault() }) + } + this.getElementJQuery()?.on("trix-file-accept") { e, _ -> e.preventDefault() } } override fun afterDestroy() { -- cgit