event-move-min.js revision 20c6c0edba6bfc7690ccf55aa36512dc98acd4be
YUI.add("event-move",function(C){var B="ontouchstart" in C.config.win,J=(B)?{start:"touchstart",move:"touchmove",end:"touchend"}:{start:"mousedown",move:"mousemove",end:"mouseup"},K="start",E="move",P="end",M="_msh",D="_mh",H="_meh",L="_ms",O="_m",I="minTime",F="minDistance",A="ownerDocument",N="nodeType",G=C.Event.define;G("movestart",{init:function(R,Q,S){R.setData(M,R.on(J[K],this._onStart,null,R,Q,S));},destroy:function(R,Q,T){var S=R.getData(M);if(S){S.detach();R.setData(M,null);}},processArgs:function(Q){var R=Q[3]?Q.splice(3,1):{};if(!(I in R)){R[I]=this.MIN_TIME;}if(!(F in R)){R[F]=this.MIN_DISTANCE;}return R;},_onStart:function(U,R,Q,T){U.preventDefault();var V=true,S;if(U.touches){V=(U.touches.length===1);U=U.touches[0];}if(V){S={target:U.target,currentTarget:U.currentTarget,time:new Date().getTime(),clientX:U.clientX,clientY:U.clientY,pageX:U.pageX,pageY:U.pageY,button:U.button,_e:U};R.setData(L,S);T.fire(S);}},MIN_TIME:0,MIN_DISTANCE:3});G("move",{init:function(R,Q,U){var T=R.get(N)===9?R:R.get(A),S=T.on(J[E],C.bind(this._onMove,this),null,R,Q,U);R.setData(D,S);},destroy:function(R,Q,T){var S=R.getData(D);if(S){S.detach();R.setData(D,null);}},_onMove:function(V,S,R,U){var W=S.getData(L),Q=!!(W),T;if(Q){if(V.touches){Q=(V.touches.length===1);V=V.touches[0];}if(Q){V.preventDefault();T={target:V.target,currentTarget:V.currentTarget,time:new Date().getTime(),clientX:V.clientX,clientY:V.clientY,pageX:V.pageX,pageY:V.pageY,button:V.button,_e:V};S.setData(O,T);U.fire(T);}}}});G("moveend",{init:function(S,R,U){var T=S.get(N)===9?S:S.get(A),Q=T.on(J[P],C.bind(this._onEnd,this),null,S,R,U);S.setData(H,Q);},destroy:function(S,R,T){var Q=S.getData(H);if(Q){Q.detach();S.setData(H,null);}},_onEnd:function(V,R,Q,U){var S=!!(R.getData(O)||R.getData(L)),T;if(S){if(V.changedTouches){if(V.changedTouches.length===1){V=V.changedTouches[0];}else{S=false;}}if(S){V.preventDefault();T={target:V.target,currentTarget:V.currentTarget,time:new Date().getTime(),clientX:V.clientX,clientY:V.clientY,pageX:V.pageX,pageY:V.pageY,button:V.button,_e:V};R.setData(L,null);R.setData(O,null);U.fire(T);}}}});},"@VERSION@",{requires:["node-base","event-touch","event-synthetic"]});