event-gestures-debug.js revision df44ce679e6e095a4e0f1a587961e4d0962b37a9
/**
* Adds support for a "flick" event, which is fired at the end of a touch or mouse based flick gesture, and provides
* velocity of the flick, along with distance and time information.
*
* @module event-gestures
* @submodule event-flick
*/
// TODO: Better way to sniff 'n' switch touch support?
start: "touchstart",
end: "touchend"
} : {
start: "mousedown",
end: "mouseup"
},
START = "start",
END = "end",
OWNER_DOCUMENT = "ownerDocument",
MIN_VELOCITY = "minVelocity",
MIN_DISTANCE = "minDistance",
_FLICK_START = "_fs",
_FLICK_START_HANDLE = "_fsh",
_FLICK_END_HANDLE = "_feh",
NODE_TYPE = "nodeType";
/**
* Sets up a "flick" event, that is fired whenever the user initiates a flick gesture on the node
* where the listener is attached. The subscriber can specify a minimum distance or velocity for
* which the event is to be fired.
*
* @event flick
* @param type {string} "flick"
* @param fn {function} The method the event invokes.
* of the flick gesture for which the event is to be fired.
*
* @return {EventHandle} the detach handle
*/
this._onStart,
this,
node,
ce);
},
if (startHandle) {
}
if (endHandle) {
}
},
processArgs: function(args) {
if (!(MIN_VELOCITY in params)) {
}
if (!(MIN_DISTANCE in params)) {
}
Y.log("flick, processArgs : minDistance =" + params.minDistance + ", minVelocity =" + params.minVelocity);
return params;
},
var i,
sub,
e = args[0];
for (i in subs) {
if (subs.hasOwnProperty(i)) {
subs[i] = null;
}
}
}
},
var start = true, // always true for mouse
doc,
origE = e;
if (e.touches) {
e = e.touches[0];
}
if (start) {
_e : e
});
if (!endHandle) {
}
}
},
endEvent = e,
time,
axis;
if (valid) {
if (e.changedTouches) {
} else {
valid = false;
}
}
if (valid) {
xyDistance = [
];
end: {
_e : e
}
});
}
}
}
},
MIN_VELOCITY : 0,
MIN_DISTANCE : 10
});
// TODO: Better way to sniff 'n' switch touch support?
start: "touchstart",
move: "touchmove",
end: "touchend"
} : {
start: "mousedown",
move: "mousemove",
end: "mouseup"
},
START = "start",
MOVE = "move",
END = "end",
_MOVE_START_HANDLE = "_msh",
_MOVE_HANDLE = "_mh",
_MOVE_END_HANDLE = "_meh",
_MOVE_START = "_ms",
_MOVE = "_m",
MIN_TIME = "minTime",
MIN_DISTANCE = "minDistance",
OWNER_DOCUMENT = "ownerDocument",
NODE_TYPE = "nodeType",
PUB_CFG = {
emitFacade:false
},
// TODO: Should this be in SynthEvent as the default?
_defArgsProcessor = function(args) {
},
},
define('movestart', {
this._onStart,
this,
node,
ce));
},
if (startHandle) {
}
},
processArgs : function(args) {
}
if (!(MIN_DISTANCE in params)) {
}
return params;
},
e.preventDefault();
var origE = e,
start = true,
if (e.touches) {
e = e.touches[0];
} else {
}
Y.log("movestart: params = button:" + button + ", minTime = " + minTime + ", minDistance = " + minDistance);
if (start) {
Y.log("movestart: No minTime or minDistance.");
} else {
if (minTime > 0) {
Y.log("movestart: minTime specified. Setup timer.");
}, this));
}
if (minDistance > 0) {
Y.log("movestart: minDistance specified. Setup native mouse/touchmove listener to measure distance.");
if (Math.abs(em.pageX - startXY[0]) > minDistance || Math.abs(em.pageY - startXY[1]) > minDistance) {
Y.log("movestart: minDistance hit.");
}
}, this));
}
}
}
},
}
}
}
},
if (params) {
}
e.type = "movestart";
},
MIN_TIME : 0,
MIN_DISTANCE : 0
});
define('move', {
this._onMove,
this,
node,
ce);
},
if (moveHandle) {
moveHandle.detach();
}
},
origE = e;
if (move) {
if (e.touches) {
e = e.touches[0];
}
if (move) {
e.type = "move";
}
}
}
});
define('moveend', {
this._onEnd,
this,
node,
ce);
},
if (endHandle) {
}
},
origE = e;
if (moveEnd) {
if (e.changedTouches) {
e = e.changedTouches[0];
} else {
moveEnd = false;
}
}
if (moveEnd) {
e.type = "moveend";
}
}
}
});