diff --git a/src/main/kotlin/nl/astraeus/komp/Komp.kt b/src/main/kotlin/nl/astraeus/komp/Komp.kt index bc54015..494811e 100644 --- a/src/main/kotlin/nl/astraeus/komp/Komp.kt +++ b/src/main/kotlin/nl/astraeus/komp/Komp.kt @@ -1,6 +1,7 @@ package nl.astraeus.komp import org.w3c.dom.HTMLElement +import kotlin.browser.window /** * User: rnentjes @@ -52,17 +53,21 @@ object Komp { if (element is HTMLElement && comp != null) { val parent = element.parentElement val newElement = comp.create() - val size = comp.getSize() - - if (size != null) { - sizeElement(newElement, size) - } parent?.replaceChild(newElement, element) + + window.setTimeout({ + resize(comp) + }) } + } } + private fun resize(component: HtmlComponent) { + println("Resize $component") + } + fun sizeElement(element: HTMLElement, size: ComponentSize) { var width = "" var height = ""