# HG changeset patch # User Lucas Thompson # Date 1490104888 0 # Node ID 0b1743589281339101f10ce11e41549c89b9d135 # Parent dd02ef0d3c933fb7ca53aebde9372f984a3165c0 Seeking with click on desktop. Remove old tap gesture code for mobile, as this should provide the same functionality. diff -r dd02ef0d3c93 -r 0b1743589281 src/app/waveform/waveform.component.html --- a/src/app/waveform/waveform.component.html Tue Mar 21 13:57:08 2017 +0000 +++ b/src/app/waveform/waveform.component.html Tue Mar 21 14:01:28 2017 +0000 @@ -1,1 +1,1 @@ -
+
diff -r dd02ef0d3c93 -r 0b1743589281 src/app/waveform/waveform.component.ts --- a/src/app/waveform/waveform.component.ts Tue Mar 21 13:57:08 2017 +0000 +++ b/src/app/waveform/waveform.component.ts Tue Mar 21 14:01:28 2017 +0000 @@ -344,11 +344,6 @@ this.timeline.timeContext.offset += newCenterTime - lastCenterTime; this.timeline.tracks.update(); }; - const seek = (ev) => { - this.audioService.seekTo( - this.timeline.timeContext.timeToPixel.invert(ev.center.x) - this.timeline.timeContext.offset - ); - }; hammertime.get('pinch').set({ enable: true }); hammertime.on('panstart', () => { this.offsetAtPanStart = this.timeline.timeContext.offset; @@ -370,7 +365,6 @@ hammertime.on('pinchend', () => { zoomGestureJustEnded = true; }); - hammertime.on('tap', seek); } this.animate(); @@ -641,4 +635,13 @@ this.playingStateSubscription.unsubscribe(); this.seekedSubscription.unsubscribe(); } + + seek(x: number): void { + if (this.timeline) { + const timeContext: any = this.timeline.timeContext; + this.audioService.seekTo( + timeContext.timeToPixel.invert(x)- timeContext.offset + ); + } + } }