From 11d9903d8fb4c40d2542b642bb84ad25e765a676 Mon Sep 17 00:00:00 2001 From: David Kaltschmidt Date: Fri, 21 Apr 2017 17:00:09 +0200 Subject: [PATCH] Remove zoom on double-click This was confusing in demos at KubeCon and DockerCon this year, as clicking on nodes kept the UI zooming in. Plus, when asked, users had no idea that double-click meant zoom in. Fixes weaveworks/service-ui#453 --- client/app/scripts/components/zoom-wrapper.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/app/scripts/components/zoom-wrapper.js b/client/app/scripts/components/zoom-wrapper.js index 8fb82f392e..8e848de86a 100644 --- a/client/app/scripts/components/zoom-wrapper.js +++ b/client/app/scripts/components/zoom-wrapper.js @@ -94,7 +94,9 @@ class ZoomWrapper extends React.Component { setZoomTriggers(zoomingEnabled) { if (zoomingEnabled) { - this.svg.call(this.zoom); + // use d3-zoom defaults but exclude double clicks + this.svg.call(this.zoom) + .on('dblclick.zoom', null); } else { this.svg.on('.zoom', null); }