Skip to content

Commit

Permalink
Merge pull request #33 from STRML/fixTouch
Browse files Browse the repository at this point in the history
Fix an issue where browser may be detected as touch-enabled but e.touches is undefined.
  • Loading branch information
mzabriskie committed Jan 18, 2015
2 parents ba038c1 + 5b55f64 commit fcef772
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/draggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ var dragEventFor = (function () {
* get {clientX, clientY} positions of control
* */
function getControlPosition(e) {
var position = !isTouchDevice ? e : e.touches[0];
var position = (e.touches && e.touches[0]) || e;
return {
clientX: position.clientX,
clientY: position.clientY
Expand Down

0 comments on commit fcef772

Please sign in to comment.