Links fixed

This commit is contained in:
barsdeveloper
2022-03-15 20:05:20 +01:00
parent b2270244a4
commit a177faf918
9 changed files with 1192 additions and 1102 deletions

View File

@@ -53,8 +53,15 @@ export default class LinkElement extends IElement {
}
#unlinkPins() {
this.#source.unlinkFrom(this.#destination)
this.#destination.unlinkFrom(this.#source)
if (this.#source && this.#destination) {
this.#source.unlinkFrom(this.#destination)
this.#destination.unlinkFrom(this.#source)
}
}
disconnectedCallback() {
super.disconnectedCallback()
this.#unlinkPins()
}
/**

View File

@@ -107,6 +107,7 @@ export default class PinElement extends IElement {
*/
linkTo(targetPinElement) {
this.entity.linkTo(targetPinElement.nodeElement.getNodeName(), targetPinElement.entity)
this.template.applyConnected(this)
}
/**
@@ -114,6 +115,7 @@ export default class PinElement extends IElement {
*/
unlinkFrom(targetPinElement) {
this.entity.unlinkFrom(targetPinElement.nodeElement.getNodeName(), targetPinElement.entity)
this.template.applyConnected(this)
}
}