dd-delegate-min.js revision 4d589fe0c1bf5d088a90cdf29f3bc777942006cb
YUI.add("dd-delegate",function(C){var B=function(D){B.superclass.constructor.apply(this,arguments);},A=C.Node.create("<div>Temp Node</div>");B.NAME="delegate";B.ATTRS={cont:{value:"body"},nodes:{value:".dd-draggable"},lastNode:{value:A},currentNode:{value:A},over:{value:false},target:{value:false}};C.extend(B,C.Base,{_dd:null,_shimState:null,initializer:function(){this._dd=new C.DD.Drag({node:A,bubbles:this});this.addTarget(C.DD.DDM);this._dd.on("drag:end",C.bind(function(D){C.DD.DDM._noShim=this._shimState;this.set("lastNode",this._dd.get("node"));this._dd._unprep();this._dd.set("node",A);},this));C.delegate("mousedown",C.bind(function(D){this._shimState=C.DD.DDM._noShim;C.DD.DDM._noShim=true;this.set("currentNode",D.currentTarget);this._dd.set("node",D.currentTarget);if(this._dd.proxy){this._dd.set("dragNode",C.DD.DDM._proxy);}else{this._dd.set("dragNode",D.currentTarget);}this._dd._prep();this._dd.fire.call(this._dd,"drag:mouseDown",{ev:D});},this),this.get("cont"),this.get("nodes"));C.on("mouseenter",C.bind(function(){this._shimState=C.DD.DDM._noShim;C.DD.DDM._noShim=true;},this),this.get("cont"));C.on("mouseleave",C.bind(function(){C.DD.DDM._noShim=this._shimState;},this),this.get("cont"));this.syncTargets();},syncTargets:function(){if(!C.Plugin.Drop){C.error("DD.Delegate: Drop Plugin Not Found");return;}if(this.get("target")){var D=C.one(this.get("cont")).all(this.get("nodes"));D.each(function(E){if(!E.drop){E.plug(C.Plugin.Drop,{useShim:false,bubbles:this});}});}return this;},plugdd:function(D,E){this._dd.plug(D,E);return this;},destructor:function(){if(this._dd){this._dd.destroy();}}});C.namespace("DD");C.DD.Delegate=B;},"@VERSION@",{skinnable:false,requires:["dd-drag","event-mouseenter"],optional:["dd-drop-plugin"]});