Get rid of the Observable class

This commit is contained in:
barsdeveloper
2023-01-02 00:46:07 +01:00
parent 392ada36ce
commit f4ebfa488a
6 changed files with 70 additions and 282 deletions

View File

@@ -161,8 +161,6 @@ export default class NodeElement extends ISelectableDraggableElement {
this.pureFunction = this.entity.bIsPureFunc
this.dragLinkObjects = []
super.setLocation([this.entity.NodePosX.value, this.entity.NodePosY.value])
this.entity.subscribe("AdvancedPinDisplay", value => this.advancedPinDisplay = value)
this.entity.subscribe("Name", value => this.nodeName = value)
if (this.entity.NodeWidth && this.entity.NodeHeight) {
this.sizeX = this.entity.NodeWidth.value
this.sizeY = this.entity.NodeHeight.value
@@ -308,6 +306,7 @@ export default class NodeElement extends ISelectableDraggableElement {
}
}
this.entity.Name = name
this.nodeName = this.entity.Name
}
getPinElements() {
@@ -338,6 +337,7 @@ export default class NodeElement extends ISelectableDraggableElement {
setShowAdvancedPinDisplay(value) {
this.entity.AdvancedPinDisplay = new IdentifierEntity(value ? "Shown" : "Hidden")
this.advancedPinDisplay = this.entity.AdvancedPinDisplay
}
toggleShowAdvancedPinDisplay() {

View File

@@ -145,15 +145,6 @@ export default class PinElement extends IElement {
this.isLinked = false
this.pinDirection = entity.isInput() ? "input" : entity.isOutput() ? "output" : "hidden"
this.nodeElement = /** @type {NodeElement} */(nodeElement)
// this.entity.subscribe("DefaultValue", value => this.defaultValue = value.toString())
this.entity.subscribe("PinToolTip", value => {
let matchResult = value.match(/\s*(.+?(?=\n)|.+\S)\s*/)
if (matchResult) {
return Utility.formatStringName(matchResult[1])
}
return Utility.formatStringName(this.entity.PinName)
})
}
setup() {