v. 0.5.12 - fix child index in refresh
Took 4 minutes
This commit is contained in:
@@ -272,11 +272,11 @@ class HtmlBuilder(
|
||||
}
|
||||
|
||||
override fun onTagStart(tag: Tag) {
|
||||
//logReplace"onTagStart, [${tag.tagName}, ${tag.namespace}], currentPosition: $currentPosition")
|
||||
logReplace("onTagStart, [${tag.tagName}, ${tag.namespace}], currentPosition: $currentPosition")
|
||||
currentNode = currentPosition.currentElement()
|
||||
|
||||
if (currentNode == null) {
|
||||
//logReplace"onTagStart, currentNode1: $currentNode")
|
||||
logReplace("onTagStart, currentNode1: $currentNode")
|
||||
currentNode = if (tag.namespace != null) {
|
||||
document.createElementNS(tag.namespace, tag.tagName)
|
||||
} else {
|
||||
@@ -292,8 +292,8 @@ class HtmlBuilder(
|
||||
!currentNode?.asElement()?.namespaceURI.equals(tag.namespace, true)
|
||||
)
|
||||
) {
|
||||
//logReplace"onTagStart, currentElement, namespace: ${currentNode?.asElement()?.namespaceURI} -> ${tag.namespace}")
|
||||
//logReplace"onTagStart, currentElement, replace: ${currentNode?.asElement()?.tagName} -> ${tag.tagName}")
|
||||
logReplace("onTagStart, currentElement, namespace: ${currentNode?.asElement()?.namespaceURI} -> ${tag.namespace}")
|
||||
logReplace("onTagStart, currentElement, replace: ${currentNode?.asElement()?.tagName} -> ${tag.tagName}")
|
||||
currentNode = if (tag.namespace != null) {
|
||||
document.createElementNS(tag.namespace, tag.tagName)
|
||||
} else {
|
||||
|
||||
@@ -114,8 +114,8 @@ abstract class Komponent {
|
||||
|
||||
val parent = currentElement.parentElement as? HTMLElement ?: error("parent is null!?")
|
||||
var childIndex = 0
|
||||
for (index in 0 until parent.children.length) {
|
||||
if (parent.children[index] == currentElement) {
|
||||
for (index in 0 until parent.childNodes.length) {
|
||||
if (parent.childNodes[index] == currentElement) {
|
||||
childIndex = index
|
||||
}
|
||||
}
|
||||
@@ -140,7 +140,7 @@ abstract class Komponent {
|
||||
var logReplaceEvent = false
|
||||
var unsafeMode = UnsafeMode.UNSAFE_DISABLED
|
||||
|
||||
fun create(parent: HTMLElement, component: Komponent, insertAsFirst: Boolean = false) {
|
||||
fun create(parent: HTMLElement, component: Komponent) {
|
||||
component.create(parent)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user