Coverage Summary for Class: StyleReceiver (kweb.html.style)
Class |
Method, %
|
Branch, %
|
Line, %
|
Instruction, %
|
StyleReceiver |
0%
(0/4)
|
|
0%
(0/10)
|
0%
(0/57)
|
StyleReceiver$DisplayValues |
0%
(0/1)
|
|
0%
(0/1)
|
0%
(0/14)
|
Total |
0%
(0/5)
|
|
0%
(0/11)
|
0%
(0/71)
|
package kweb.html.style
import kotlinx.serialization.json.JsonPrimitive
import kweb.Element
/**
* Created by ian on 2/12/17.
*/
class StyleReceiver(private val parent: Element) {
fun setDisplay(value: DisplayValues) {
parent.browser.callJsFunction(
"document.getElementById({}).style.display = {}",
JsonPrimitive(parent.id),
JsonPrimitive(value.toString())
)
}
fun setWidth(value: String) {
parent.browser.callJsFunction(
"document.getElementById({}).style.width = {}",
JsonPrimitive(parent.id),
JsonPrimitive(value)
)
}
fun remove() {
parent.removeAttribute("style")
}
enum class DisplayValues {
none, block
}
}