Skip to content

Commit

Permalink
account for empty touches
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Bailey committed Jan 7, 2015
1 parent c523765 commit 535b645
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion slider.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ sliderDirective = ($timeout) ->
currentRef = ref
scope.$apply()
onMove = (event) ->
eventX = event.clientX || event.touches[0].clientX
eventX = event.clientX || event.touches?[0]?.clientX || 0
newOffset = eventX - element[0].getBoundingClientRect().left - handleHalfWidth
newOffset = Math.max(Math.min(newOffset, maxOffset), minOffset)
newPercent = percentOffset newOffset
Expand Down
4 changes: 2 additions & 2 deletions slider.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 535b645

Please sign in to comment.