Skip to content

Commit

Permalink
Bugfix. When elements get clicked (not swiped): TypeError: maximumsMa…
Browse files Browse the repository at this point in the history
…p[direction] is undefined
  • Loading branch information
willosof committed Jun 10, 2013
1 parent 0af3ba8 commit fb3b4e0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions jquery.touchSwipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -1597,9 +1597,10 @@
* @return int The distance of the swipe
* @inner
*/
function getMaxDistance(direction) {
return maximumsMap[direction].distance;
}
function getMaxDistance(direction) {
if (maximumsMap[direction]) return maximumsMap[direction].distance;
return undefined;
}

/**
* Creats a map of directions to maximum swiped values.
Expand Down Expand Up @@ -1958,4 +1959,4 @@
* @param {DomObject} target The element clicked on.
*/

})(jQuery);
})(jQuery);

0 comments on commit fb3b4e0

Please sign in to comment.