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
This commit is contained in:
James E. Blair
2022-08-04 11:00:02 -07:00
parent db445d5cac
commit af80f8dfdc
@@ -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()