Skip to content

Commit 31ed55f

Browse files
committed
listenToChanges
1 parent e4106aa commit 31ed55f

File tree

2 files changed

+19
-21
lines changed

2 files changed

+19
-21
lines changed

services/static-webserver/client/source/class/osparc/data/model/Node.js

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ qx.Class.define("osparc.data.model.Node", {
489489
this.populateNodeUIData(nodeData);
490490
// new place to store the position and marker
491491
this.populateNodeUIData(nodeUiData);
492+
this.listenToChanges();
492493
})
493494
.catch(err => {
494495
console.log(err);
@@ -1350,28 +1351,26 @@ qx.Class.define("osparc.data.model.Node", {
13501351
this.self().ListenChangesProps.forEach(key => {
13511352
switch (key) {
13521353
case "inputs":
1353-
if (this.hasPropsForm()) {
1354-
// listen to changes in the props form
1355-
this.getPropsForm().addListener("changeData", () => {
1356-
const data = this.__getInputData();
1357-
this.fireDataEvent("projectDocumentChanged", {
1358-
"op": "replace",
1359-
"path": `/workbench/${nodeId}/inputs`,
1360-
"value": data,
1361-
"osparc-resource": "node",
1362-
});
1354+
// listen to changes in the props form
1355+
this.getPropsForm().addListener("changeData", () => {
1356+
const data = this.__getInputData();
1357+
this.fireDataEvent("projectDocumentChanged", {
1358+
"op": "replace",
1359+
"path": `/workbench/${nodeId}/inputs`,
1360+
"value": data,
1361+
"osparc-resource": "node",
13631362
});
1364-
// listen to changes in link and unlink of ports
1365-
this.getPropsForm().addListener("linkFieldModified", () => {
1366-
const data = this.__getInputData();
1367-
this.fireDataEvent("projectDocumentChanged", {
1368-
"op": "replace",
1369-
"path": `/workbench/${nodeId}/inputs`,
1370-
"value": data,
1371-
"osparc-resource": "node",
1372-
});
1363+
});
1364+
// listen to changes in link and unlink of ports
1365+
this.getPropsForm().addListener("linkFieldModified", () => {
1366+
const data = this.__getInputData();
1367+
this.fireDataEvent("projectDocumentChanged", {
1368+
"op": "replace",
1369+
"path": `/workbench/${nodeId}/inputs`,
1370+
"value": data,
1371+
"osparc-resource": "node",
13731372
});
1374-
}
1373+
});
13751374
break;
13761375
case "inputsUnits":
13771376
if (this.hasPropsForm()) {

services/static-webserver/client/source/class/osparc/data/model/Workbench.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,6 @@ qx.Class.define("osparc.data.model.Workbench", {
390390
},
391391

392392
__initNodeSignals: function(node) {
393-
node.listenToChanges();
394393
node.addListener("projectDocumentChanged", e => this.fireDataEvent("projectDocumentChanged", e.getData()), this);
395394
node.addListener("keyChanged", () => this.fireEvent("reloadModel"), this);
396395
node.addListener("changeInputNodes", () => this.fireDataEvent("pipelineChanged"), this);

0 commit comments

Comments
 (0)