Skip to content

Commit 67aac25

Browse files
committed
Zoom out RangeSlider.Preview on double click
1 parent 877db99 commit 67aac25

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
@@ -380,6 +380,15 @@ Rickshaw.Graph.RangeSlider.Preview = Rickshaw.Class.create({
380380
});
381381
}
382382

383+
function zoomOut() {
384+
self.graphs.forEach(function(graph) {
385+
graph.window.xMin = undefined;
386+
graph.window.xMax = undefined;
387+
388+
graph.update();
389+
});
390+
}
391+
383392
function onMousedown() {
384393
drag.target = d3.event.target;
385394
drag.start = self._getClientXFromEvent(d3.event, drag);
@@ -427,6 +436,7 @@ Rickshaw.Graph.RangeSlider.Preview = Rickshaw.Class.create({
427436
element.select("rect.left_handle").on("touchstart", onMousedownLeftHandle);
428437
element.select("rect.right_handle").on("touchstart", onMousedownRightHandle);
429438
element.select("rect.middle_handle").on("touchstart", onMousedownMiddleHandle);
439+
element.on("dblclick", zoomOut);
430440
},
431441

432442
_getClientXFromEvent: function(event, drag) {

0 commit comments

Comments
 (0)