Makes sure the correct Element's clear() method is called - Fixes #4

This commit is contained in:
Peter Klimai 2019-10-12 12:30:56 +03:00
parent 7f0b08fcc9
commit 0581d63315

View File

@ -16,6 +16,7 @@ import info.laht.threekt.loaders.Cache.clear
import kotlinx.html.div import kotlinx.html.div
import kotlinx.html.dom.append import kotlinx.html.dom.append
import org.w3c.dom.Element import org.w3c.dom.Element
import kotlin.dom.clear
import kotlin.js.json import kotlin.js.json
operator fun Name.plus(other: NameToken): Name = Name(tokens + other) operator fun Name.plus(other: NameToken): Name = Name(tokens + other)
@ -123,7 +124,7 @@ private fun VisualObject.toTree(onFocus: (VisualObject?, String?) -> Unit = { _,
} }
fun Element.visualObjectTree(group: VisualObject, onFocus: (VisualObject?, String?) -> Unit) { fun Element.visualObjectTree(group: VisualObject, onFocus: (VisualObject?, String?) -> Unit) {
clear() this.clear()
append { append {
card("Visual object tree") { card("Visual object tree") {
val domConfig = jsObject<DomConfig> { val domConfig = jsObject<DomConfig> {