mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Fix removing links when deleting node
This commit is contained in:
parent
fc709ba266
commit
7be7dec19a
@ -31,7 +31,7 @@ RED.nodes = (function() {
|
||||
|
||||
var groups = {};
|
||||
var groupsByZ = {};
|
||||
|
||||
RED.nl = nodeLinks;
|
||||
var initialLoad;
|
||||
|
||||
var dirty = false;
|
||||
@ -429,13 +429,13 @@ RED.nodes = (function() {
|
||||
var index = links.indexOf(l);
|
||||
if (index != -1) {
|
||||
links.splice(index,1);
|
||||
if (l.source) {
|
||||
if (l.source && nodeLinks[l.source.id]) {
|
||||
var sIndex = nodeLinks[l.source.id].out.indexOf(l)
|
||||
if (sIndex !== -1) {
|
||||
nodeLinks[l.source.id].out.splice(sIndex,1)
|
||||
}
|
||||
}
|
||||
if (l.target) {
|
||||
if (l.target && nodeLinks[l.target.id]) {
|
||||
var tIndex = nodeLinks[l.target.id].in.indexOf(l)
|
||||
if (tIndex !== -1) {
|
||||
nodeLinks[l.target.id].in.splice(tIndex,1)
|
||||
|
Loading…
Reference in New Issue
Block a user