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/12 18:59:04 UTC
incubator-nifi git commit: 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 th
Repository: incubator-nifi
Updated Branches:
refs/heads/develop 1da5339a2 -> b6b185947
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.
Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/b6b18594
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/b6b18594
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/b6b18594
Branch: refs/heads/develop
Commit: b6b1859475eadc7d2802b2da29863878f77d54cd
Parents: 1da5339
Author: Matt Gilman <ma...@gmail.com>
Authored: Mon Jan 12 12:56:37 2015 -0500
Committer: Matt Gilman <ma...@gmail.com>
Committed: Mon Jan 12 12:56:37 2015 -0500
----------------------------------------------------------------------
.../src/main/webapp/js/nf/canvas/nf-canvas.js | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/b6b18594/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
index c367860..5c1cbb8 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
@@ -372,8 +372,12 @@ nf.Canvas = (function () {
})
.datum(position);
- // prevent further propagation (to parents)
- d3.event.stopPropagation();
+ // prevent further propagation (to parents and others handlers
+ // 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 () {
@@ -385,7 +389,7 @@ nf.Canvas = (function () {
// get the original position
var originalPosition = selectionBox.datum();
var position = d3.mouse(canvas.node());
-
+
var d = {};
if (originalPosition[0] < position[0]) {
d.x = originalPosition[0];
@@ -407,6 +411,7 @@ nf.Canvas = (function () {
selectionBox.attr(d);
}
+ // prevent further propagation (to parents)
d3.event.stopPropagation();
}
})