summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E. Blair <jim@acmegating.com>2022-08-04 09:27:39 -0700
committerJames E. Blair <jim@acmegating.com>2022-08-04 11:00:02 -0700
commitaf80f8dfdc7edbf65d69e969e8eb866987e66d21 (patch)
treecd5f0b71cc474a88b2b342346791e73d901e2210
parentdb445d5cac4a9851c509fa54bb8786451b9ed59e (diff)
downloadzuul-af80f8dfdc7edbf65d69e969e8eb866987e66d21.tar.gz
Web: disable scroll wheel zoom in job graph
When scrolling the project page with a job graph rendered, users using scroll wheels (or similar input devices) may be surprised that once their pointer moves over the job graph, it begin zooming instead of the page scrolling. Disable zooming the job graph with the mouse wheel so that the behavior remains consistent. Zooming is still possible with click/shift-click. Change-Id: Ic3884f1317cb7799e4e387aa51c81c080e028d10
-rw-r--r--web/src/containers/jobgraph/JobGraphDisplay.jsx4
1 files changed, 4 insertions, 0 deletions
diff --git a/web/src/containers/jobgraph/JobGraphDisplay.jsx b/web/src/containers/jobgraph/JobGraphDisplay.jsx
index 9bd67e7d2..e5cff9cbc 100644
--- a/web/src/containers/jobgraph/JobGraphDisplay.jsx
+++ b/web/src/containers/jobgraph/JobGraphDisplay.jsx
@@ -77,6 +77,10 @@ function GraphViz(props) {
gv._originalTransform.y = val
}
+ // Disable scroll wheel zooming because it interferes with window
+ // scrolling
+ gv.zoomSelection().on('wheel.zoom', null)
+
// Mutate the links to be internal links
d3.select('.zuul-job-graph').selectAll('.node a').on('click', event => {
d3.event.preventDefault()