diff options
author | Robert Jaros <rjaros@finn.pl> | 2017-10-28 23:45:26 +0200 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2017-10-28 23:45:26 +0200 |
commit | 06f297d68887c7934e66d2c757abc8bf619df66a (patch) | |
tree | a828eec09f0bdc99b0f3fd45972b8cead37fbdec /src/main/kotlin/pl/treksoft/kvision/modal | |
parent | 6b13b8909a302b0f0f2155b81b83cd5ab4d7a046 (diff) | |
download | kvision-06f297d68887c7934e66d2c757abc8bf619df66a.tar.gz kvision-06f297d68887c7934e66d2c757abc8bf619df66a.tar.bz2 kvision-06f297d68887c7934e66d2c757abc8bf619df66a.zip |
Databinding components
Event handlers refactoring
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/modal')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt b/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt index 94796326..a4e14d5c 100644 --- a/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt +++ b/src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt @@ -1,7 +1,7 @@ package pl.treksoft.kvision.modal import com.github.snabbdom.VNode -import pl.treksoft.kvision.core.Container +import pl.treksoft.kvision.panel.SimplePanel import pl.treksoft.kvision.core.Root import pl.treksoft.kvision.core.Widget import pl.treksoft.kvision.helpers.CloseIcon @@ -20,7 +20,7 @@ enum class MODALSIZE(val className: String) { @Suppress("TooManyFunctions") open class Modal(caption: String? = null, closeButton: Boolean = true, size: MODALSIZE? = null, animation: Boolean = true, private val escape: Boolean = true, - classes: Set<String> = setOf()) : Container(classes) { + classes: Set<String> = setOf()) : SimplePanel(classes) { private var caption get() = captionTag.text set(value) { @@ -45,17 +45,17 @@ open class Modal(caption: String? = null, closeButton: Boolean = true, } private val dialog = ModalDialog(size) - private val header = Container(setOf("modal-header")) + private val header = SimplePanel(setOf("modal-header")) protected val closeIcon = CloseIcon() private val captionTag = Tag(TAG.H4, caption, classes = setOf("modal-title")) - protected val body = Container(setOf("modal-body")) - private val footer = Container(setOf("modal-footer")) + protected val body = SimplePanel(setOf("modal-body")) + private val footer = SimplePanel(setOf("modal-footer")) init { this.hide() this.role = "dialog" this.addInternal(dialog) - val content = Container(setOf("modal-content")) + val content = SimplePanel(setOf("modal-content")) dialog.role = "document" dialog.add(content) closeIcon.visible = closeButton @@ -87,12 +87,12 @@ open class Modal(caption: String? = null, closeButton: Boolean = true, } } - override fun add(child: Widget): Container { + override fun add(child: Widget): SimplePanel { body.add(child) return this } - override fun addAll(children: List<Widget>): Container { + override fun addAll(children: List<Widget>): SimplePanel { body.addAll(children) return this } @@ -171,7 +171,7 @@ open class Modal(caption: String? = null, closeButton: Boolean = true, } } -open class ModalDialog(size: MODALSIZE?) : Container(setOf("modal-dialog")) { +open class ModalDialog(size: MODALSIZE?) : SimplePanel(setOf("modal-dialog")) { var size = size set(value) { field = value |