From b7afc6999e488cac0e9f4003d87f0a6e81541824 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Mon, 5 Jan 2015 07:43:19 -0500 Subject: [PATCH] NIFI-223: - Addressing issue when dragging multiple components. Issue stemmed from skipping the PUT request when the component (a connection with no bends points) was included in the selection. --- .../src/main/webapp/js/nf/canvas/nf-draggable.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-draggable.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-draggable.js index 2eb3f1b3b8..1858e60862 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-draggable.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-draggable.js @@ -87,7 +87,7 @@ nf.Draggable = (function () { var updateConnectionPosition = function(d) { // only update if necessary if (d.component.bends.length === 0) { - return; + return null; } // calculate the new bend points @@ -149,7 +149,10 @@ nf.Draggable = (function () { // go through each selected connection d3.selectAll('g.connection.selected').each(function (d) { - updates.set(d.component.id, updateConnectionPosition(d)); + var connectionUpdate = updateConnectionPosition(d); + if (connectionUpdate !== null) { + updates.set(d.component.id, connectionUpdate); + } }); // go through each selected component @@ -158,7 +161,10 @@ nf.Draggable = (function () { var connections = nf.Connection.getComponentConnections(d.component.id); $.each(connections, function(_, connection) { if (!updates.has(connection.id) && nf.CanvasUtils.getConnectionSourceComponentId(connection) === nf.CanvasUtils.getConnectionDestinationComponentId(connection)) { - updates.set(connection.id, updateConnectionPosition(nf.Connection.get(connection.id))); + var connectionUpdate = updateConnectionPosition(nf.Connection.get(connection.id)); + if (connectionUpdate !== null) { + updates.set(connection.id, connectionUpdate); + } } });