jquerymobile-swipeupdown
jquerymobile-swipeupdown copied to clipboard
Cannot declare property 'touches' of undefined
This line here:
var data = event.originalEvent.touches ? event.originalEvent.touches[ 0 ] : event;
Should be more like:
var data = 'originalEvent' in event && 'touches' in event.originalEvent && event.originalEvent.touches ?
event.originalEvent.touches[0] : ('touches' in event && event.touches ? event.touches[0] : event);
Otherwise it throws an error when the touches are found in event, rather than originalevent (which isn't always there). It was causing weird results sometimes on swipeup gestures, causing subsequent javascript not to fire. I made the above change and cleared my errors and solved my issue with the subsequent js.
If you would like to make a PR, I will review and merge.