event-mouseenter-min.js revision 21f450f4fd5fd60f951de44878aae015ed0342e3
YUI.add("event-mouseenter",function(G){var C=G.Event,E=G.Lang,B=G.Env.evt.plugins,D={},F=function(I){var H=I.relatedTarget;if(!H){if(I.type=="mouseout"){H=I.toElement;}else{if(I.type=="mouseover"){H=I.fromElement;}}}return H;},A={on:function(M,O,I){var L=G.Array(arguments,0,true),K=I,R;if(E.isString(I)){K=G.all(I);if(K.size()===0){return C.onAvailable(I,function(){G.on.apply(G,L);},C,true,false);}}if(K instanceof G.NodeList||C._isValidCollection(K)){R=[];G.each(K,function(U,T){L[2]=U;R.push(G.on.apply(G,L));});return(R.length===1)?R[0]:R;}K=G.Node.getDOMNode(I);var S=(M==="mouseenter")?"mouseover":"mouseout",Q=M+":"+G.stamp(K)+S,J=D[Q],N,P,H;if(!J){N=C._attach([S,G.rbind(C._fireMouseEnter,G,K,Q),K],{facade:false});G.after(function(T){if(N.sub==T){delete D[Q];G.detachAll(Q);}},N.evt,"_delete");J={};J.handle=N;D[Q]=J;}H=J.count;J.count=H?(H+1):1;L[0]=Q;L.splice(2,1);P=G.on.apply(G,L);G.after(function(){J.count=(J.count-1);if(J.count===0){J.handle.detach();}},P,"detach");return P;}};C._fireMouseEnter=function(L,K,I){var H=F(L),J;if(K!==H&&!G.DOM.contains(K,H)){J=new G.DOMEventFacade(L,K);G.publish(I,{contextFn:function(){return J.currentTarget;}});G.fire(I,J);}};B.mouseenter=A;B.mouseleave=A;},"@VERSION@",{requires:["node-base"]});