Repository: incubator-nifi
Updated Branches:
  refs/heads/develop 4d998c12c -> 203e83ee0


NIFI-143:
- Added a check to ensure that a process does not attempt to drop on itself.

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

Branch: refs/heads/develop
Commit: c3ba275c63a05de14ed0fb0055b948697ccb05c5
Parents: 4d998c1
Author: Matt Gilman <[email protected]>
Authored: Tue Dec 9 08:17:31 2014 -0500
Committer: Matt Gilman <[email protected]>
Committed: Tue Dec 9 08:17:31 2014 -0500

----------------------------------------------------------------------
 .../webapp/js/nf/canvas/nf-process-group.js     | 33 +++++++++++++-------
 1 file changed, 22 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/c3ba275c/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group.js
----------------------------------------------------------------------
diff --git 
a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group.js
 
b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group.js
index c5234b6..180484a 100644
--- 
a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group.js
+++ 
b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group.js
@@ -148,24 +148,35 @@ nf.ProcessGroup = (function () {
 
         // always support selecting and navigation
         processGroup.on('dblclick', function (d) {
-            // enter this group on double click
-            nf.CanvasUtils.enterGroup(d.component.id);
-        })
+                    // enter this group on double click
+                    nf.CanvasUtils.enterGroup(d.component.id);
+                })
                 .call(nf.Selectable.activate).call(nf.ContextMenu.activate);
 
         // only support dragging, connection, and drag and drop if appropriate
         if (nf.Common.isDFM()) {
             processGroup
-                    //Using mouseover/out to workaround chrom issue #122746
+                    // Using mouseover/out to workaround chrome issue #122746
                     .on('mouseover.drop', function (d) {
+                        // get the target and ensure its not already been 
marked for drop
                         var target = d3.select(this);
-
-                        //mark that we are hovering over a drop area if 
appropriate 
-                        if (!target.classed('drop') && 
!d3.select('rect.drag-selection').empty()) {
-                            target.classed('drop', function () {
-                                //get the current selection and ensure its 
disconnected
-                                return 
nf.CanvasUtils.isDisconnected(nf.CanvasUtils.getSelection());
-                            });
+                        if (!target.classed('drop')) {
+                            var targetData = target.datum();
+                            
+                            // see if there is a selection being dragged
+                            var selection = d3.select('rect.drag-selection');
+                            if (!selection.empty()) {
+                                var selectionData = selection.datum();
+                                
+                                // ensure what is being dragged isn't the 
target
+                                if (targetData.component.id !== 
selectionData.component.id) {
+                                    // mark that we are hovering over a drop 
area if appropriate 
+                                    target.classed('drop', function () {
+                                        // get the current selection and 
ensure its disconnected
+                                        return 
nf.CanvasUtils.isDisconnected(nf.CanvasUtils.getSelection());
+                                    });
+                                }
+                            }
                         }
                     })
                     .on('mouseout.drop', function (d) {

Reply via email to