joseph / Monocle

A silky, tactile browser-based ebook JavaScript library.
http://monocle.inventivelabs.com.au
MIT License
743 stars 200 forks source link

Support a variance for basic onTap detection #208

Closed danshultz closed 10 years ago

danshultz commented 10 years ago

Some devices are not tolerant of fat finger touches and will issue a move event in between a down/start and up/end event. This causes "onTap" to not perform well in some scenarios.

Supporting a tolerance for what constitutes as a "tap" provides the a fill gap for devices that issue erroneous events. This was mostly observed on the surface tablet and some instances of windows 8 touch devices.

The threshold can be adjusted by changing Gala.onTap.maxContactTime and Gala.onTap.maxContactDistance.

Upon further testing on different devices this is working well without issue. I know we discussed adding an onDrag abstraction but in reviewing different functionality across books I am not sure if this is necessary at this moment in time.

Please review this pull request and merge

danshultz commented 10 years ago

Pull request has been updated to incorporate the feedback and remove the "max" time to be considered a "tap"

joseph commented 10 years ago

Thanks.