diff --git a/src/js/Rickshaw.Graph.RangeSlider.Preview.js b/src/js/Rickshaw.Graph.RangeSlider.Preview.js index 86b39347..5a161023 100644 --- a/src/js/Rickshaw.Graph.RangeSlider.Preview.js +++ b/src/js/Rickshaw.Graph.RangeSlider.Preview.js @@ -408,6 +408,15 @@ Rickshaw.Graph.RangeSlider.Preview = Rickshaw.Class.create({ }); } + function zoomOut() { + self.graphs.forEach(function(graph) { + graph.window.xMin = undefined; + graph.window.xMax = undefined; + + graph.update(); + }); + } + function onMousedown() { drag.target = d3.event.target; drag.start = self._getClientXFromEvent(d3.event, drag); @@ -455,6 +464,7 @@ Rickshaw.Graph.RangeSlider.Preview = Rickshaw.Class.create({ element.select("rect.left_handle").on("touchstart", onMousedownLeftHandle); element.select("rect.right_handle").on("touchstart", onMousedownRightHandle); element.select("rect.middle_handle").on("touchstart", onMousedownMiddleHandle); + element.on("dblclick", zoomOut); }, _getClientXFromEvent: function(event, drag) {