1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Mark nodes that have really moved as changed

This commit is contained in:
Nick O'Leary 2017-06-29 23:23:16 +01:00
parent e59eff83b9
commit 7429f66d6b
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -961,10 +961,14 @@ RED.view = (function() {
if (moving_set.length > 0) { if (moving_set.length > 0) {
var ns = []; var ns = [];
for (var j=0;j<moving_set.length;j++) { for (var j=0;j<moving_set.length;j++) {
ns.push({n:moving_set[j].n,ox:moving_set[j].ox,oy:moving_set[j].oy,moved:moving_set[j].n.moved}); var n = moving_set[j];
moving_set[j].n.dirty = true; if (n.ox !== n.n.x || n.oy !== n.n.y) {
moving_set[j].n.moved = true; ns.push({n:n.n,ox:n.ox,oy:n.oy,moved:n.n.moved});
n.n.dirty = true;
n.n.moved = true;
} }
}
if (ns.length > 0) {
historyEvent = {t:"move",nodes:ns,dirty:RED.nodes.dirty()}; historyEvent = {t:"move",nodes:ns,dirty:RED.nodes.dirty()};
if (activeSpliceLink) { if (activeSpliceLink) {
// TODO: DRY - droppable/nodeMouseDown/canvasMouseUp // TODO: DRY - droppable/nodeMouseDown/canvasMouseUp
@ -990,6 +994,7 @@ RED.view = (function() {
RED.history.push(historyEvent); RED.history.push(historyEvent);
} }
} }
}
if (mouse_mode == RED.state.MOVING || mouse_mode == RED.state.MOVING_ACTIVE) { if (mouse_mode == RED.state.MOVING || mouse_mode == RED.state.MOVING_ACTIVE) {
for (i=0;i<moving_set.length;i++) { for (i=0;i<moving_set.length;i++) {
delete moving_set[i].ox; delete moving_set[i].ox;
@ -2185,10 +2190,10 @@ RED.view = (function() {
thisNode.selectAll(".node_changed") thisNode.selectAll(".node_changed")
.attr("x",function(d){return d.w-10}) .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") 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; }); .classed("hidden",function(d) { return d.valid; });
thisNode.selectAll(".port_input").each(function(d,i) { thisNode.selectAll(".port_input").each(function(d,i) {