Skip to content

Commit

Permalink
Use preventDefault() on timeline scrolling.
Browse files Browse the repository at this point in the history
  • Loading branch information
fbarl committed Jul 27, 2017
1 parent 07aff05 commit 4b19216
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/app/scripts/components/time-travel-timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,15 @@ class TimeTravelTimeline extends React.Component {
this.setState({ focusedTimestamp });
}

handleZoom(e) {
const scale = Math.pow(ZOOM_SENSITIVITY, e.deltaY);
handleZoom(ev) {
const scale = Math.pow(ZOOM_SENSITIVITY, ev.deltaY);
let durationPerPixel = scaleDuration(this.state.durationPerPixel, scale);
if (durationPerPixel > MAX_DURATION_PER_PX) durationPerPixel = MAX_DURATION_PER_PX;
if (durationPerPixel < MIN_DURATION_PER_PX) durationPerPixel = MIN_DURATION_PER_PX;

trackMixpanelEvent('scope.time.timeline.zoom', { scale });
this.setState({ durationPerPixel });
ev.preventDefault();
}

jumpTo(timestamp) {
Expand Down

0 comments on commit 4b19216

Please sign in to comment.