You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by mc...@apache.org on 2015/01/05 14:34:23 UTC

[2/2] incubator-nifi git commit: 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.

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.

Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/b7afc699
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/b7afc699
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/b7afc699

Branch: refs/heads/develop
Commit: b7afc6999e488cac0e9f4003d87f0a6e81541824
Parents: c1eb209
Author: Matt Gilman <ma...@gmail.com>
Authored: Mon Jan 5 07:43:19 2015 -0500
Committer: Matt Gilman <ma...@gmail.com>
Committed: Mon Jan 5 07:43:19 2015 -0500

----------------------------------------------------------------------
 .../src/main/webapp/js/nf/canvas/nf-draggable.js        | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/b7afc699/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-draggable.js
----------------------------------------------------------------------
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 2eb3f1b..1858e60 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);
+                    }
                 }
             });