diff --git a/build.gradle b/build.gradle index beec3c6..bb779b3 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ group 'nl.astraeus' -version '0.1.10' +version '0.1.14-SNAPSHOT' apply plugin: 'kotlin2js' apply plugin: 'kotlin-dce-js' diff --git a/komp.iml b/komp.iml index dcc02e8..6fc34e8 100644 --- a/komp.iml +++ b/komp.iml @@ -1,5 +1,5 @@ - + @@ -34,8 +34,8 @@ - - + + diff --git a/src/main/kotlin/nl/astraeus/komp/Komponent.kt b/src/main/kotlin/nl/astraeus/komp/Komponent.kt index 6c6a645..d047306 100644 --- a/src/main/kotlin/nl/astraeus/komp/Komponent.kt +++ b/src/main/kotlin/nl/astraeus/komp/Komponent.kt @@ -26,14 +26,15 @@ abstract class Komponent { open fun create(): HTMLElement { val consumer = HtmlBuilder(this, document) - val result = render(consumer) + consumer.render() + val result = consumer.finalize() element = result return result } - abstract fun render(consumer: HtmlBuilder): HTMLElement + abstract fun HtmlBuilder.render() open fun style(className: String, vararg imports: CssStyle, block: CSSStyleDeclaration.() -> Unit = {}) { val style = (document.createElement("div") as HTMLDivElement).style