widget-child-min.js revision aacc7c2be5854cf3e80028d47a46b6e6c39cc7ce
YUI.add("widget-child",function(C){var B=C.Lang;function A(){C.after(this._syncUIChild,this,"syncUI");C.after(this._bindUIChild,this,"bindUI");}A.ATTRS={selected:{value:0,validator:B.isNumber},index:{readOnly:true,getter:function(){var H=this.get("parent"),E,F;if(H){E=H.get("items");for(var G=0,D=E.length;G<D;G++){if(this==E[G]){F=G;break;}}}return F;}},parent:{readOnly:true},depth:{value:-1,readOnly:true,getter:function(){var D=this.get("parent"),E=-1;while(D){E=(E+1);D=D.get("parent");}return E;}},root:{readOnly:true,getter:function(){var D=function(F){var E=F.get("parent");return(E?D(E):F);};return D(this);}}};A.prototype={_getRootNode:function(){var D=this.get("root"),E;if(D){E=D.get("boundingBox");}return E;},next:function(){var E=this.get("parent"),D;if(E){D=E.item((this.get("index")+1));}return D;},previous:function(){var F=this.get("parent"),D=this.get("index"),E;if(F&&D>0){E=F.item([(D+1)]);}return E;},remove:function(D){var E;if(B.isNumber(D)){C.WidgetParent.prototype.remove.apply(this,arguments);}else{E=this.get("parent");if(E){E.remove(this.get("index"));}}},isRoot:function(){return(this==this.get("root"));},ancestor:function(E){var D;if(this.get("depth")>=E&&E>0){D=this.get("parent");while(D.get("depth")>E){D=D.get("parent");}}return D;},_uiSetChildSelected:function(E){var F=this.get("boundingBox"),D=this.getClassName("selected");if(E===0){F.removeClass(D);}else{F.addClass(D);}},_afterChildSelectedChange:function(D){this._uiSetChildSelected(D.newVal);},_syncUIChild:function(){this._uiSetChildSelected(this.get("selected"));},_bindUIChild:function(){this.after("selectedChange",this._afterChildSelectedChange);}};C.WidgetChild=A;},"@VERSION@",{requires:["widget"]});