Skip to content

Commit ad02b0e

Browse files
committed
Zoom out RangeSlider.Preview on double click
1 parent 5286770 commit ad02b0e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/js/Rickshaw.Graph.RangeSlider.Preview.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,15 @@ Rickshaw.Graph.RangeSlider.Preview = Rickshaw.Class.create({
408408
});
409409
}
410410

411+
function zoomOut() {
412+
self.graphs.forEach(function(graph) {
413+
graph.window.xMin = undefined;
414+
graph.window.xMax = undefined;
415+
416+
graph.update();
417+
});
418+
}
419+
411420
function onMousedown() {
412421
drag.target = d3.event.target;
413422
drag.start = self._getClientXFromEvent(d3.event, drag);
@@ -455,6 +464,7 @@ Rickshaw.Graph.RangeSlider.Preview = Rickshaw.Class.create({
455464
element.select("rect.left_handle").on("touchstart", onMousedownLeftHandle);
456465
element.select("rect.right_handle").on("touchstart", onMousedownRightHandle);
457466
element.select("rect.middle_handle").on("touchstart", onMousedownMiddleHandle);
467+
element.on("dblclick", zoomOut);
458468
},
459469

460470
_getClientXFromEvent: function(event, drag) {

0 commit comments

Comments
 (0)