NIFI-247:

- Preventing zoom/pan events which was throwing off the selection when the cursor left the canvas when using the selection box to select multiple components.
- Preventing default browser behavior which was changing the cursor to text-selection when using the selection box to select multiple components.
This commit is contained in:
Matt Gilman 2015-01-12 12:56:37 -05:00
parent 1da5339a2a
commit b6b1859475
1 changed files with 8 additions and 3 deletions

View File

@ -372,8 +372,12 @@ nf.Canvas = (function () {
}) })
.datum(position); .datum(position);
// prevent further propagation (to parents) // prevent further propagation (to parents and others handlers
d3.event.stopPropagation(); // on the same element to prevent zoom behavior)
d3.event.stopImmediatePropagation();
// prevents the browser from changing to a text selection cursor
d3.event.preventDefault();
} }
}) })
.on('mousemove.selection', function () { .on('mousemove.selection', function () {
@ -407,6 +411,7 @@ nf.Canvas = (function () {
selectionBox.attr(d); selectionBox.attr(d);
} }
// prevent further propagation (to parents)
d3.event.stopPropagation(); d3.event.stopPropagation();
} }
}) })