diff options
author | Robert Jaros <rjaros@finn.pl> | 2017-09-17 04:28:09 +0200 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2017-09-17 04:28:09 +0200 |
commit | ab12f9a29f7517e6ad5923b687f8ff476fc83a93 (patch) | |
tree | e22a30fd6d54f63f538dd81a609f794991d986ea /src/main/kotlin/pl/treksoft/kvision/helpers | |
parent | 5d5db76ff0d9d1505c4a41cd84e871793a7a7b8d (diff) | |
download | kvision-ab12f9a29f7517e6ad5923b687f8ff476fc83a93.tar.gz kvision-ab12f9a29f7517e6ad5923b687f8ff476fc83a93.tar.bz2 kvision-ab12f9a29f7517e6ad5923b687f8ff476fc83a93.zip |
Modals
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/helpers')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/helpers/CloseIcon.kt | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/helpers/CloseIcon.kt b/src/main/kotlin/pl/treksoft/kvision/helpers/CloseIcon.kt new file mode 100644 index 00000000..b5f1a642 --- /dev/null +++ b/src/main/kotlin/pl/treksoft/kvision/helpers/CloseIcon.kt @@ -0,0 +1,25 @@ +package pl.treksoft.kvision.helpers + +import com.github.snabbdom.VNode +import pl.treksoft.kvision.core.KVManager +import pl.treksoft.kvision.core.Widget +import pl.treksoft.kvision.snabbdom.StringBoolPair +import pl.treksoft.kvision.snabbdom.StringPair + +open class CloseIcon(classes: Set<String> = setOf()) : Widget(classes) { + + override fun render(): VNode { + return kvh("button", arrayOf(KVManager.virtualize("<span aria-hidden='true'>×</span>"))) + } + + override fun getSnClass(): List<StringBoolPair> { + val cl = super.getSnClass().toMutableList() + cl.add("close" to true) + return cl + } + + override fun getSnAttrs(): List<StringPair> { + return super.getSnAttrs() + listOf("type" to "button", "aria-label" to "Close") + } + +} |