diff options
author | Robert Jaros <rjaros@finn.pl> | 2017-11-25 13:39:39 +0100 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2017-11-25 13:39:39 +0100 |
commit | 343390df5a0e01f45539939291c35d535a1b8af6 (patch) | |
tree | fcba5b87efa1b740bd5a011739af1e066cba28f0 /src/main/kotlin/pl/treksoft/kvision/panel/StackPanel.kt | |
parent | 4a31ea44d479358658a614ad56a5675436260813 (diff) | |
download | kvision-343390df5a0e01f45539939291c35d535a1b8af6.tar.gz kvision-343390df5a0e01f45539939291c35d535a1b8af6.tar.bz2 kvision-343390df5a0e01f45539939291c35d535a1b8af6.zip |
Form validation
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/panel/StackPanel.kt')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/panel/StackPanel.kt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/panel/StackPanel.kt b/src/main/kotlin/pl/treksoft/kvision/panel/StackPanel.kt index e8975dce..55bd2cca 100644 --- a/src/main/kotlin/pl/treksoft/kvision/panel/StackPanel.kt +++ b/src/main/kotlin/pl/treksoft/kvision/panel/StackPanel.kt @@ -1,7 +1,7 @@ package pl.treksoft.kvision.panel import com.github.snabbdom.VNode -import pl.treksoft.kvision.core.Widget +import pl.treksoft.kvision.core.Component open class StackPanel(private val activateLast: Boolean = true, classes: Set<String> = setOf()) : SimplePanel(classes) { @@ -19,21 +19,21 @@ open class StackPanel(private val activateLast: Boolean = true, } } - override fun add(child: Widget): StackPanel { + override fun add(child: Component): StackPanel { super.add(child) if (activateLast) activeIndex = children.size - 1 else if (activeIndex == -1) activeIndex = 0 return this } - override fun addAll(children: List<Widget>): StackPanel { + override fun addAll(children: List<Component>): StackPanel { super.addAll(children) if (activateLast) activeIndex = this.children.size - 1 else if (activeIndex == -1) activeIndex = 0 return this } - override fun remove(child: Widget): StackPanel { + override fun remove(child: Component): StackPanel { super.remove(child) if (activeIndex > children.size - 1) activeIndex = children.size - 1 return this |