瀏覽代碼

GUI: reenable input ports when other objects driving them are deleted

dds
PaulStoffregen 10 年之前
父節點
當前提交
038d091793
共有 1 個文件被更改,包括 16 次插入0 次删除
  1. +16
    -0
      gui/red/ui/view.js

+ 16
- 0
gui/red/ui/view.js 查看文件

@@ -729,6 +729,22 @@ RED.view = (function() {
node.x = 25
}
var rmlinks = RED.nodes.remove(node.id);
for (var i=0; i < rmlinks.length; i++) {
var link = rmlinks[i];
//console.log("delete link: " + link.source.id + ":" + link.sourcePort
// + " -> " + link.target.id + ":" + link.targetPort);
if (link.source == node) {
// reenable input port
var n = link.targetPort;
var rect = link.target.inputlist[n];
rect.on("mousedown", (function(d,n){return function(d){portMouseDown(d,1,n);}})(rect, n))
.on("touchstart", (function(d,n){return function(d){portMouseDown(d,1,n);}})(rect, n))
.on("mouseup", (function(d,n){return function(d){portMouseUp(d,1,n);}})(rect, n))
.on("touchend", (function(d,n){return function(d){portMouseUp(d,1,n);}})(rect, n))
.on("mouseover",function(d) { var port = d3.select(this); port.classed("port_hovered",(mouse_mode!=RED.state.JOINING || mousedown_port_type != 1 ));})
.on("mouseout",function(d) { var port = d3.select(this); port.classed("port_hovered",false);})
}
}
removedNodes.push(node);
removedLinks = removedLinks.concat(rmlinks);
}

Loading…
取消
儲存