Initial commit

This commit is contained in:
barsdeveloper
2021-06-29 16:26:39 +02:00
commit 02e8e6e8af
18 changed files with 811 additions and 0 deletions

35
js/UEBlueprintDOMModel.js Normal file
View File

@@ -0,0 +1,35 @@
export default class UEBlueprintDOMModel {
static dummyDiv = document.createElement('div')
static domTemplate(obj) {
return ``
}
constructor() {
this.domElement = null
}
createDOMElement() {
if (this.domElement) {
this.removeDOMElement()
}
this.constructor.dummyDiv.innerHTML = this.constructor.domTemplate(this)
this.domElement = this.constructor.dummyDiv.removeChild(this.constructor.dummyDiv.firstElementChild)
}
getDOMElement() {
if (!this.domElement) {
this.createDOMElement()
}
return this.domElement
}
removeDOMElement() {
if (!this.domElement) {
return false
}
this.domElement.parentElement.removeChild(this.domElement)
this.domElement = null
return true
}
}