From 15d7031ebda7faa6a2297ddf090c3ea0b17a32fb Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Tue, 16 Dec 2014 15:34:39 -0500 Subject: [PATCH] NIFI-143: - Using the datum from the appropriate selection. - Handling group selection. --- .../main/webapp/js/nf/canvas/nf-process-group.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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 a585fc807b..0bd522c8b4 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 @@ -164,12 +164,15 @@ nf.ProcessGroup = (function () { 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(); + var drag = d3.select('rect.drag-selection'); + if (!drag.empty()) { + // filter the current selection by this group + var selection = nf.CanvasUtils.getSelection().filter(function(d) { + return targetData.component.id === d.component.id; + }); - // ensure what is being dragged isn't the target - if (targetData.component.id !== selectionData.component.id) { + // ensure this group isn't in the selection + if (selection.empty()) { // mark that we are hovering over a drop area if appropriate target.classed('drop', function () { // get the current selection and ensure its disconnected