diff --git a/editor/js/ui/view.js b/editor/js/ui/view.js index 39a3a6288..d8cfc3637 100644 --- a/editor/js/ui/view.js +++ b/editor/js/ui/view.js @@ -961,33 +961,38 @@ RED.view = (function() { if (moving_set.length > 0) { var ns = []; for (var j=0;j 0) { + historyEvent = {t:"move",nodes:ns,dirty:RED.nodes.dirty()}; + if (activeSpliceLink) { + // TODO: DRY - droppable/nodeMouseDown/canvasMouseUp + var spliceLink = d3.select(activeSpliceLink).data()[0]; + RED.nodes.removeLink(spliceLink); + var link1 = { + source:spliceLink.source, + sourcePort:spliceLink.sourcePort, + target: moving_set[0].n + }; + var link2 = { + source:moving_set[0].n, + sourcePort:0, + target: spliceLink.target + }; + RED.nodes.addLink(link1); + RED.nodes.addLink(link2); + historyEvent.links = [link1,link2]; + historyEvent.removedLinks = [spliceLink]; + updateActiveNodes(); + } + RED.nodes.dirty(true); + RED.history.push(historyEvent); } - RED.nodes.dirty(true); - RED.history.push(historyEvent); } } if (mouse_mode == RED.state.MOVING || mouse_mode == RED.state.MOVING_ACTIVE) { @@ -2185,10 +2190,10 @@ RED.view = (function() { thisNode.selectAll(".node_changed") .attr("x",function(d){return d.w-10}) - .classed("hidden",function(d) { return !d.changed; }); + .classed("hidden",function(d) { return !(d.changed||d.moved); }); thisNode.selectAll(".node_error") - .attr("x",function(d){return d.w-10-(d.changed?13:0)}) + .attr("x",function(d){return d.w-10-((d.changed||d.moved)?13:0)}) .classed("hidden",function(d) { return d.valid; }); thisNode.selectAll(".port_input").each(function(d,i) {