Flick.js revision 1ef3baa403986374362a3287c4aa7ddb032e1684
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * Adds support for a "flick" event, which is fired at the end of a touch or mouse based flick gesture, and provides
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * velocity of the flick, along with distance and time information.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * @module event-gestures
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * @submodule event-flick
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync// TODO: Better way to sniff 'n' switch touch support?
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * Sets up a "flick" event, that is fired whenever the user initiates a flick gesture on the node
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * where the listener is attached. The subscriber can specify a minimum distance or velocity for
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * which the event is to be fired.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * @event flick
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * @param type {string} "flick"
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * @param fn {function} The method the event invokes.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * @param cfg {Object} Optional. An object which specifies the minimum distance and/or velocity
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * of the flick gesture for which the event is to be fired.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * @return {EventHandle} the detach handle
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync var startHandle = node.getData(_FLICK_START_HANDLE),
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync var params = (args[3]) ? args.splice(3, 1)[0] : {};
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync Y.log("flick, processArgs : minDistance =" + params.minDistance + ", minVelocity =" + params.minVelocity);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync doc = (node.get(NODE_TYPE) === 9) ? node : node.get(OWNER_DOCUMENT);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync endHandle = doc.on(EVENT[END], Y.bind(this._onEnd, this), null, node, subscriber, ce);
endEvent = e,
time,
axis;
if (valid) {
if (e.changedTouches) {
valid = false;
if (valid) {
xyDistance = [
end: {
_e : e