Skip to content

Commit

Permalink
Zoom out RangeSlider.Preview on double click
Browse files Browse the repository at this point in the history
  • Loading branch information
rbu committed Apr 1, 2014
1 parent 877db99 commit 67aac25
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/js/Rickshaw.Graph.RangeSlider.Preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,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);
Expand Down Expand Up @@ -427,6 +436,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) {
Expand Down

0 comments on commit 67aac25

Please sign in to comment.