Use onadd in link nodes to ensure imported links are updated

This commit is contained in:
Nick O'Leary
2016-05-18 16:48:16 +01:00
parent 3e9be9eed3
commit 5ad46106f4
3 changed files with 19 additions and 8 deletions

View File

@@ -195,9 +195,6 @@ RED.nodes = (function() {
}
nodes.push(n);
}
if (n._def.onadd) {
n._def.onadd.call(n);
}
}
function addLink(l) {
links.push(l);

View File

@@ -2208,6 +2208,14 @@ RED.view = (function() {
node.n.y -= minY;
node.dx -= minX;
node.dy -= minY;
if (node.n._def.onadd) {
try {
node.n._def.onadd.call(node.n);
} catch(err) {
console.log("onadd:",err);
}
}
}
if (!touchImport) {
mouse_mode = RED.state.IMPORT_DRAGGING;
@@ -2218,7 +2226,6 @@ RED.view = (function() {
node.n._def.outputs > 0;
}
}
RED.keyboard.add("*",/* ESCAPE */ 27,function(){
RED.keyboard.remove(/* ESCAPE */ 27);
clearSelection();