diff options
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/panel/TabPanel.kt')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/panel/TabPanel.kt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/panel/TabPanel.kt b/src/main/kotlin/pl/treksoft/kvision/panel/TabPanel.kt index 9072d261..067a8146 100644 --- a/src/main/kotlin/pl/treksoft/kvision/panel/TabPanel.kt +++ b/src/main/kotlin/pl/treksoft/kvision/panel/TabPanel.kt @@ -35,8 +35,9 @@ import pl.treksoft.kvision.routing.routing * * @constructor * @param classes a set of CSS class names + * @param init an initializer extension function */ -open class TabPanel(classes: Set<String> = setOf()) : SimplePanel(classes) { +open class TabPanel(classes: Set<String> = setOf(), init: (TabPanel.() -> Unit)? = null) : SimplePanel(classes) { /** * The index of active (visible) tab. @@ -61,6 +62,9 @@ open class TabPanel(classes: Set<String> = setOf()) : SimplePanel(classes) { init { this.addInternal(nav) this.addInternal(content) + + @Suppress("LeakingThis") + init?.invoke(this) } /** |