event-flick.js revision 2d6dc2a0e10bdba75ae44aa511c00d3f2b5cb4ff
b33d3bf66f037e3c87d1b857d3706eee0072e0cdNicholas * Adds support for a "flick" event, which is fired at the end of a touch or mouse based flick gesture, and provides
b33d3bf66f037e3c87d1b857d3706eee0072e0cdNicholas * velocity of the flick, along with distance and time information.
b33d3bf66f037e3c87d1b857d3706eee0072e0cdNicholas * @module event-gestures
b33d3bf66f037e3c87d1b857d3706eee0072e0cdNicholas * @submodule event-flick
b33d3bf66f037e3c87d1b857d3706eee0072e0cdNicholas// TODO: Better way to sniff 'n' switch touch support?
b33d3bf66f037e3c87d1b857d3706eee0072e0cdNicholas * Sets up a "flick" event, that is fired whenever the user initiates a flick gesture on the node
b33d3bf66f037e3c87d1b857d3706eee0072e0cdNicholas * where the listener is attached. The subscriber can specify a minimum distance or velocity for
b33d3bf66f037e3c87d1b857d3706eee0072e0cdNicholas * which the event is to be fired.
b33d3bf66f037e3c87d1b857d3706eee0072e0cdNicholas * @event flick
b33d3bf66f037e3c87d1b857d3706eee0072e0cdNicholas * @param type {string} "flick"
b33d3bf66f037e3c87d1b857d3706eee0072e0cdNicholas * @param fn {function} The method the event invokes.
b33d3bf66f037e3c87d1b857d3706eee0072e0cdNicholas * @param cfg {Object} Optional. An object which specifies the minimum distance and/or velocity
this._onStart,
node,
ce);
if (startHandle) {
if (endHandle) {
return params;
doc,
origE = e;
if (e.touches) {
if (start) {
_e : e
if (!endHandle) {
endEvent = e,
time,
axis;
if (valid) {
if (e.changedTouches) {
valid = false;
if (valid) {
xyDistance = [
end: {
_e : e