diff options
author | Robert Jaros <rjaros@finn.pl> | 2019-10-14 15:05:24 +0200 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2019-10-14 15:05:24 +0200 |
commit | f9501852c29365edf09c1d98518d407ae9a3fbde (patch) | |
tree | aaae5a02532cf88f5274caaf4097901f438eb004 /src/main/kotlin/pl/treksoft/kvision/panel | |
parent | 280ca97bd0591d46f47f3143641a470a8704b634 (diff) | |
download | kvision-f9501852c29365edf09c1d98518d407ae9a3fbde.tar.gz kvision-f9501852c29365edf09c1d98518d407ae9a3fbde.tar.bz2 kvision-f9501852c29365edf09c1d98518d407ae9a3fbde.zip |
Return root container from Application extension functions.
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/panel')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/panel/Root.kt | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/panel/Root.kt b/src/main/kotlin/pl/treksoft/kvision/panel/Root.kt index c206ea02..7d06428a 100644 --- a/src/main/kotlin/pl/treksoft/kvision/panel/Root.kt +++ b/src/main/kotlin/pl/treksoft/kvision/panel/Root.kt @@ -218,9 +218,10 @@ class Root : SimplePanel { * @param fixed if false, the container is rendered with Bootstrap "container-fluid" class, * otherwise it's rendered with "container" class (default is false) * @param init an initializer extension function + * @return the created Root container */ - fun Application.root(id: String, fixed: Boolean = false, init: Root.() -> Unit) { - Root(id, fixed, init) + fun Application.root(id: String, fixed: Boolean = false, init: Root.() -> Unit): Root { + return Root(id, fixed, init) } /** @@ -229,9 +230,10 @@ class Root : SimplePanel { * @param fixed if false, the container is rendered with Bootstrap "container-fluid" class, * otherwise it's rendered with "container" class (default is false) * @param init an initializer extension function + * @return the created Root container */ - fun Application.root(element: HTMLElement, fixed: Boolean = false, init: Root.() -> Unit) { - Root(element, fixed, init) + fun Application.root(element: HTMLElement, fixed: Boolean = false, init: Root.() -> Unit): Root { + return Root(element, fixed, init) } } |