summaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2018-01-31 00:07:23 +0100
committerRobert Jaros <rjaros@finn.pl>2018-01-31 00:07:23 +0100
commitd7059e321f796301c19cb1b9746eb3e27d7480bd (patch)
tree43f297d4a0646af5948aa3cc06bb836779097e56 /src/main/kotlin/pl/treksoft/kvision
parent20224268cfd05aefd935547e44dd938cf6e2e312 (diff)
downloadkvision-d7059e321f796301c19cb1b9746eb3e27d7480bd.tar.gz
kvision-d7059e321f796301c19cb1b9746eb3e27d7480bd.tar.bz2
kvision-d7059e321f796301c19cb1b9746eb3e27d7480bd.zip
Option to disable Bootstrap CSS
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/core/KVManager.kt16
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/routing/Routing.kt2
2 files changed, 15 insertions, 3 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/core/KVManager.kt b/src/main/kotlin/pl/treksoft/kvision/core/KVManager.kt
index 55c91436..7ca0ce26 100644
--- a/src/main/kotlin/pl/treksoft/kvision/core/KVManager.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/core/KVManager.kt
@@ -9,15 +9,23 @@ import com.github.snabbdom.eventListenersModule
import com.github.snabbdom.propsModule
import com.github.snabbdom.styleModule
import pl.treksoft.kvision.require
+import pl.treksoft.kvision.routing.Routing
import pl.treksoft.kvision.routing.routing
import kotlin.browser.document
import kotlin.dom.clear
+external val kvBootstrap: Boolean?
+
object KVManager {
internal const val AJAX_REQUEST_DELAY = 300
internal const val KVNULL = "#kvnull"
- private val bootstrapWebpack = require("bootstrap-webpack")
+ @Suppress("UnsafeCastFromDynamic")
+ private val bootstrapWebpack = if (js("typeof KV_NO_BOOTSTRAP_CSS !== 'undefined'")) {
+ require("bootstrap-webpack!./js/bootstrap.config.js")
+ } else {
+ require("bootstrap-webpack")
+ }
private val fontAwesomeWebpack = require("font-awesome-webpack")
private val resizable = require("jquery-resizable-dom")
private val awesomeBootstrapCheckbox = require("awesome-bootstrap-checkbox")
@@ -26,7 +34,7 @@ object KVManager {
private val bootstrapSelectI18n = require("./js/bootstrap-select-i18n.min.js")
private val bootstrapSelectAjaxCss = require("ajax-bootstrap-select/dist/css/ajax-bootstrap-select.min.css")
private val bootstrapSelectAjax = require("ajax-bootstrap-select/dist/js/ajax-bootstrap-select.min.js")
-// private val bootstrapSelectAjaxI18n =
+ // private val bootstrapSelectAjaxI18n =
// require("ajax-bootstrap-select/dist/js/locale/ajax-bootstrap-select.pl-PL.min.js")
private val trixCss = require("trix/dist/trix.css")
private val trix = require("trix")
@@ -63,6 +71,10 @@ object KVManager {
fun init() {
}
+ fun start() {
+ routing = Routing()
+ }
+
fun shutdown() {
routing.destroy()
}
diff --git a/src/main/kotlin/pl/treksoft/kvision/routing/Routing.kt b/src/main/kotlin/pl/treksoft/kvision/routing/Routing.kt
index 709f966c..fab8643c 100644
--- a/src/main/kotlin/pl/treksoft/kvision/routing/Routing.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/routing/Routing.kt
@@ -4,4 +4,4 @@ import pl.treksoft.navigo.Navigo
open class Routing : Navigo(null, true, "#!")
-val routing = Routing()
+var routing = Routing()