Make elements default constructible, testing wip

This commit is contained in:
barsdeveloper
2022-12-24 15:29:12 +01:00
parent 7ed36f21e5
commit c3ab6478b0
53 changed files with 992 additions and 712 deletions

View File

@@ -24,22 +24,21 @@ export default class ISelectableDraggableElement extends IDraggableElement {
},
}
constructor(...args) {
// @ts-expect-error
super(...args)
dragHandler = e => this.addLocation(e.detail.value)
constructor() {
super()
this.selected = false
this.listeningDrag = false
let self = this
this.dragHandler = e => self.addLocation(e.detail.value)
}
connectedCallback() {
super.connectedCallback()
setup() {
super.setup()
this.setSelected(this.selected)
}
disconnectedCallback() {
super.disconnectedCallback()
cleanup() {
super.cleanup()
this.blueprint.removeEventListener(Configuration.nodeDragGeneralEventName, this.dragHandler)
}