aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2018-03-22 12:43:49 +0100
committerRobert Jaros <rjaros@finn.pl>2018-03-22 12:43:49 +0100
commit6b77ea5c82d0806cc697e9a269f9f64fbff96273 (patch)
treea9029e354f8e38c85bd9446a693e7700cd834906 /src/main/kotlin/pl/treksoft
parent567a42eb216381b951fe5c6bcc199bcba835ffa6 (diff)
downloadkvision-6b77ea5c82d0806cc697e9a269f9f64fbff96273.tar.gz
kvision-6b77ea5c82d0806cc697e9a269f9f64fbff96273.tar.bz2
kvision-6b77ea5c82d0806cc697e9a269f9f64fbff96273.zip
Fix incorrect padding with container-fluid root.
Diffstat (limited to 'src/main/kotlin/pl/treksoft')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/panel/ResponsiveGridPanel.kt2
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/panel/Root.kt11
2 files changed, 11 insertions, 2 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/panel/ResponsiveGridPanel.kt b/src/main/kotlin/pl/treksoft/kvision/panel/ResponsiveGridPanel.kt
index 4bbca9dd..edcf5789 100644
--- a/src/main/kotlin/pl/treksoft/kvision/panel/ResponsiveGridPanel.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/panel/ResponsiveGridPanel.kt
@@ -57,7 +57,7 @@ open class ResponsiveGridPanel(
private val gridSize: GridSize = GridSize.MD,
private var rows: Int = 0, private var cols: Int = 0, align: Align? = null,
classes: Set<String> = setOf(), init: (ResponsiveGridPanel.() -> Unit)? = null
-) : SimplePanel(classes) {
+) : SimplePanel(classes + "container-fluid") {
/**
* Text align of grid cells.
diff --git a/src/main/kotlin/pl/treksoft/kvision/panel/Root.kt b/src/main/kotlin/pl/treksoft/kvision/panel/Root.kt
index 8223023e..a51191d4 100644
--- a/src/main/kotlin/pl/treksoft/kvision/panel/Root.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/panel/Root.kt
@@ -22,9 +22,12 @@
package pl.treksoft.kvision.panel
import com.github.snabbdom.VNode
+import com.github.snabbdom.h
import pl.treksoft.kvision.KVManager
import pl.treksoft.kvision.core.StringBoolPair
import pl.treksoft.kvision.modal.Modal
+import pl.treksoft.kvision.utils.snClasses
+import pl.treksoft.kvision.utils.snOpt
/**
* Root container.
@@ -54,7 +57,13 @@ class Root(id: String, private val fixed: Boolean = false, init: (Root.() -> Uni
}
override fun render(): VNode {
- return render("div#$id", childrenVNodes() + modalsVNodes())
+ return if (!fixed) {
+ render("div#$id", arrayOf(h("div", snOpt {
+ `class` = snClasses(listOf("row" to true))
+ }, childrenVNodes() + modalsVNodes())))
+ } else {
+ render("div#$id", childrenVNodes() + modalsVNodes())
+ }
}
internal fun addModal(modal: Modal) {