Type.registerNamespace("Telerik.Web.UI"); Telerik.Web.UI.RadDockZonesGlobalArray=[]; Telerik.Web.UI.registerRadDockZone=function(a){if(!Array.contains(this.RadDockZonesGlobalArray,a)){Array.add(this.RadDockZonesGlobalArray,a); }}; Telerik.Web.UI.unregisterRadDockZone=function(a){Array.remove(this.RadDockZonesGlobalArray,a); }; $telerik.toDockZone=function(a){return a; }; $telerik.findDockZone=$find; Telerik.Web.UI.RadDockZone=function(a){Telerik.Web.UI.RadDockZone.initializeBase(this,[a]); this._clientID=null; this._highlightedCssClass=null; this._fitDocks=true; this._uniqueName=null; this._layoutID=null; this._dropDownTouchScroll=null; }; Telerik.Web.UI.RadDockZone.prototype={initialize:function(){Telerik.Web.UI.RadDockZone.callBaseMethod(this,"initialize"); this._resetDockIndices(); this._placeholder=$get(this.get_clientID()+"_D"); if($telerik.isRightToLeft(this.get_element())){Sys.UI.DomElement.addCssClass(this._placeholder,"rdRtl"); }this._clearElement=$get(this.get_clientID()+"_C"); if(Telerik.Web.UI.TouchScrollExtender._getNeedsScrollExtender()&&!this._dropDownTouchScroll){this._createTouchScrollExtender(true); }Telerik.Web.UI.registerRadDockZone(this); },dispose:function(){this._createTouchScrollExtender(false); Telerik.Web.UI.unregisterRadDockZone(this); Telerik.Web.UI.RadDockZone.callBaseMethod(this,"dispose"); },_createTouchScrollExtender:function(c){var d=this.get_element(); if(d){var a=this._dropDownTouchScroll; if(a){if(!c){a.dispose(); this._dropDownTouchScroll=null; }}else{if(c){var b=$telerik.$(d).css("overflowY"); if(b=="auto"){this._dropDownTouchScroll=new Telerik.Web.UI.TouchScrollExtender(d); this._dropDownTouchScroll.initialize(); }}}}},dock:function(d,b){var a=this.get_docks(); var c=null; if(a.length>b){c=a[b].get_element(); }this._dockBefore(d,c,false); d._hitZone=null; },get_docks:function(){var c=[]; var a=this.get_element().firstChild; while(a!=null){if(a!=this._placeholder&&a.id){var b=$find(a.id); if(b&&Telerik.Web.UI.RadDock&&Telerik.Web.UI.RadDock.isInstanceOfType(b)){Array.add(c,b); }}a=a.nextSibling; }return c; },_dockBefore:function(j,d,h,f){f=f?f:false; var e=j.get_element(); var b=this.get_element(); var i=j.get_enableAnimation()?j.get_animationDuration():0; var c={}; var l; if(d){if(d!=this._placeholder){b.insertBefore(this._placeholder,d); d=this._placeholder; }l=d; l.style.display=""; var m=$telerik.getLocation(l); var k=$telerik.getBounds(l); c.left=m.x; c.top=m.y; var g=k.width>5?k.width:parseInt(j.get_width()); c.width=g; }else{l=this._clearElement; i=0; }var n=j.get_titleElement(); if(n!=null){n.style.display="none"; }if(!f||i==0){this._onDockBeforeAnimationEnd(j,l,h); return; }var a=this; $telerik.$(e).animate(c,i,function(){a._onDockBeforeAnimationEnd(j,l,h); }); },_onDockBeforeAnimationEnd:function(e,c,b){var g=e.get_element(); var a=this.get_element(); if(c){if(c.className.indexOf("rdPlaceHolder")!=-1){c.style.display="none"; }}var f=e.get_titleElement(); if(f!=null){f.style.display="block"; }if(e._closed){g.style.display="none"; }a.insertBefore(g,c); var d=$find(e.get_dockZoneID()); if(d){d._resetDockIndices(); }e.set_dockZone(this); e.set_dockZoneID(a.id); if(this.get_fitDocks()){if(!this.get_isHorizontal()){e._fitWidth(); }}else{if(!this.get_isHorizontal()){e._unfitWidth(); }}e._resetPosition(); e._setPinUnpinVisibility(); this._resetDockIndices(); if(b){e.raise_dockPositionChanged(new Sys.EventArgs()); }},_resetDockIndices:function(){var a=this.get_docks(); for(var b=0; ba.x&&b.x<(a.x+a.width)&&b.y>a.y&&b.y<(a.y+a.height)); },_showPlaceholder:function(g,c){this._repositionPlaceholder(g.get_element(),c); var h=this.get_docks(); if(h.length>0){for(var a=0; a0&&Array.indexOf(b.get_forbiddenZones(),a)<0&&(c.length==0||Array.indexOf(c,a)>=0)); },drop:function(b){var a=new Sys.CancelEventArgs(); b.raise_dockPositionChanging(a); this._hidePlaceholder(); if(this.get_highlightedCssClass()!=null){this.removeCssClass(this.get_highlightedCssClass()); }if(a.get_cancel()){b._restorePosition(); }else{this._dockBefore(b,this._placeholder,true,true); }},dragEnterTarget:function(b,a){this._showPlaceholder(b,a); if(this.get_highlightedCssClass()!=null){this.addCssClass(this.get_highlightedCssClass()); }},onDragInTarget:function(b,a){this._repositionPlaceholder(b.get_element(),a); },dragLeaveTarget:function(a){this._hidePlaceholder(); if(this.get_highlightedCssClass()!=null){this.removeCssClass(this.get_highlightedCssClass()); }},hitTest:function(c,f,d){if(!this.canDrop(c)){return false; }if(d==null){d=true; }var a=$telerik.getDocumentRelativeCursorPosition(f); var b=$telerik.isTouchDevice?$telerik.getTouchEventLocation(f):{x:a.left,y:a.top}; if($telerik.containsPoint($telerik.getBounds(this.get_element()),b.x,b.y)){if(d){this.dragEnterTarget(c,b); }return true; }else{this.dragLeaveTarget(c); return false; }},getScrollOffset:function(c,b){var e=c.scrollLeft; var d=c.scrollTop; if(b){var a=c.parentNode; while(a!=null&&a.scrollLeft!=null){e+=a.scrollLeft; d+=a.scrollTop; if(a==document.body&&(e!=0&&d!=0)){break; }a=a.parentNode; }}return{x:e,y:d}; },clone:function(c){if(!c){c="RadDockZoneClone_"+(new Date()-100); }var a=this.get_element(); var f=a.cloneNode(true); f.setAttribute("id",c); f.removeAttribute("control"); f.innerHTML=""; var b=this._placeholder.cloneNode(true); b.setAttribute("id",c+"_D"); f.appendChild(b); var e=$get(this._clientStateFieldID).cloneNode(true); e.setAttribute("id",c+"_ClientState"); f.appendChild(e); var d; if(this._clearElement){d=this._clearElement.cloneNode(true); d.setAttribute("id",c+"_C"); f.appendChild(d); }a.parentNode.insertBefore(f,a.nextSibling); var g=$telerik.cloneControl(this,Telerik.Web.UI.RadDockZone,f); g._uniqueName=c; g._placeholder=b; if(d){g._clearElement=d; }return g; },addPoints:function(a,b){return{x:a.x+b.x,y:a.y+b.y}; },get_clientID:function(){return this._clientID; },set_clientID:function(a){this._clientID=a; },get_fitDocks:function(){return this._fitDocks; },set_fitDocks:function(a){this._fitDocks=a; },get_highlightedCssClass:function(){return this._highlightedCssClass; },set_highlightedCssClass:function(a){this._highlightedCssClass=a; },get_layoutID:function(){return this._layoutID; },set_layoutID:function(a){this._layoutID=a; },get_uniqueName:function(){return this._uniqueName; },set_uniqueName:function(a){this._uniqueName=a; }}; Telerik.Web.UI.RadDockZone.registerClass("Telerik.Web.UI.RadDockZone",Telerik.Web.UI.RadWebControl);