aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/KVManager.kt12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/KVManager.kt b/src/main/kotlin/pl/treksoft/kvision/KVManager.kt
index 0030cf9d..e1c169c0 100644
--- a/src/main/kotlin/pl/treksoft/kvision/KVManager.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/KVManager.kt
@@ -29,6 +29,7 @@ import com.github.snabbdom.datasetModule
import com.github.snabbdom.eventListenersModule
import com.github.snabbdom.propsModule
import com.github.snabbdom.styleModule
+import org.w3c.dom.asList
import pl.treksoft.kvision.core.Component
import pl.treksoft.kvision.utils.isIE11
import kotlin.browser.document
@@ -48,8 +49,17 @@ internal object KVManager {
internal const val AJAX_REQUEST_DELAY = 300
internal const val KVNULL = "#kvnull"
+ private val links = document.getElementsByTagName("link")
private val bootstrapWebpack = try {
- require("bootstrap-webpack")
+ val bootswatch = links.asList().find { it.getAttribute("href")?.contains("bootstrap.min.css") ?: false }
+ if (bootswatch != null) {
+ if (bootswatch.getAttribute("href")?.contains("/paper/") ?: false) {
+ require("./css/paper.css")
+ }
+ require("bootstrap-webpack!./js/bootstrap.config.js")
+ } else {
+ require("bootstrap-webpack")
+ }
} catch (e: Throwable) {
}
private val fontAwesomeWebpack = try {