From 6b77ea5c82d0806cc697e9a269f9f64fbff96273 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Thu, 22 Mar 2018 12:43:49 +0100 Subject: Fix incorrect padding with container-fluid root. --- src/main/kotlin/pl/treksoft/kvision/panel/Root.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/main/kotlin/pl/treksoft/kvision/panel/Root.kt') 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) { -- cgit