diff options
author | Robert Jaros <rjaros@finn.pl> | 2020-05-20 15:11:04 +0200 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2020-05-20 15:11:04 +0200 |
commit | 6c1c0e7bb02843a8088a011dbfb224605c201dd7 (patch) | |
tree | db0f8735f75d700afa1f2af4a1ab29f3818962a8 /kvision-modules/kvision-bootstrap-select-remote/src/main/kotlin | |
parent | 432ce23431a77d76c48ca9abe464efeb4f0885bb (diff) | |
download | kvision-6c1c0e7bb02843a8088a011dbfb224605c201dd7.tar.gz kvision-6c1c0e7bb02843a8088a011dbfb224605c201dd7.tar.bz2 kvision-6c1c0e7bb02843a8088a011dbfb224605c201dd7.zip |
Support relative links for remote endpoints
Diffstat (limited to 'kvision-modules/kvision-bootstrap-select-remote/src/main/kotlin')
-rw-r--r-- | kvision-modules/kvision-bootstrap-select-remote/src/main/kotlin/pl/treksoft/kvision/form/select/SelectRemoteInput.kt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kvision-modules/kvision-bootstrap-select-remote/src/main/kotlin/pl/treksoft/kvision/form/select/SelectRemoteInput.kt b/kvision-modules/kvision-bootstrap-select-remote/src/main/kotlin/pl/treksoft/kvision/form/select/SelectRemoteInput.kt index b6319a6b..b2dad8fe 100644 --- a/kvision-modules/kvision-bootstrap-select-remote/src/main/kotlin/pl/treksoft/kvision/form/select/SelectRemoteInput.kt +++ b/kvision-modules/kvision-bootstrap-select-remote/src/main/kotlin/pl/treksoft/kvision/form/select/SelectRemoteInput.kt @@ -67,7 +67,7 @@ open class SelectRemoteInput<T : Any>( ) : SelectInput(null, value, multiple, null, classes) { private val kvUrlPrefix = window["kv_remote_url_prefix"] - private val urlPrefix: String = if (kvUrlPrefix != undefined) kvUrlPrefix else "" + private val urlPrefix: String = if (kvUrlPrefix != undefined) "$kvUrlPrefix/" else "" private val url: String private val labelsCache = mutableMapOf<String, String>() @@ -84,7 +84,7 @@ open class SelectRemoteInput<T : Any>( } val tempAjaxOptions = ajaxOptions ?: AjaxOptions() this.ajaxOptions = tempAjaxOptions.copy( - url = urlPrefix + url, + url = urlPrefix + url.drop(1), preprocessData = { @Suppress("UnsafeCastFromDynamic") JSON.plain.parse(RemoteOption.serializer().list, it.result as String).map { |