Add insertAsFirst option
This commit is contained in:
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,4 +1,4 @@
|
|||||||
#Sat Apr 01 17:12:59 CEST 2017
|
#Sun Apr 02 16:55:00 CEST 2017
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
@@ -16,10 +16,14 @@ object Komp {
|
|||||||
elements[element] = component
|
elements[element] = component
|
||||||
}
|
}
|
||||||
|
|
||||||
fun create(parent: HTMLElement, component: HtmlComponent) {
|
fun create(parent: HTMLElement, component: HtmlComponent, insertAsFirst: Boolean = false) {
|
||||||
val element = component.create()
|
val element = component.create()
|
||||||
|
|
||||||
parent.appendChild(element)
|
if (insertAsFirst && parent.childElementCount > 0) {
|
||||||
|
parent.insertBefore(element, parent.firstChild)
|
||||||
|
} else {
|
||||||
|
parent.appendChild(element)
|
||||||
|
}
|
||||||
|
|
||||||
elements[element] = component
|
elements[element] = component
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user