Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.SplitterSlideDirection=function(){
};
Telerik.Web.UI.SplitterSlideDirection.prototype={Right:1,Left:2,Top:3,Bottom:4};
Telerik.Web.UI.SplitterSlideDirection.registerEnum("Telerik.Web.UI.SplitterSlideDirection",false);
Telerik.Web.UI.RadSlidingZone=function(_1){
Telerik.Web.UI.RadSlidingZone.initializeBase(this,[_1]);
this._width=null;
this._height=null;
this._clickToOpen=false;
this._resizeStep=0;
this._slideDuration=150;
this._splitter=null;
this._slideDirection=Telerik.Web.UI.SplitterSlideDirection.Right;
this._slidingPanes=[];
this._slidingPanesById=[];
this._dockedPaneId=null;
this._initiallyDockedPaneId=null;
this._expandedPaneId=null;
this.GetPaneById=this.getPaneById;
this.GetTabsContainer=this.getTabsContainer;
this.DockPane=this.dockPane;
this.UndockPane=this.undockPane;
this.GetPanes=this.getPanes;
this.ExpandPane=this.expandPane;
this.CollapsePane=this.collapsePane;
this.IsLeftDirection=this.isLeftDirection;
this.IsRightDirection=this.isRightDirection;
this.IsTopDirection=this.isTopDirection;
this.IsBottomDirection=this.isBottomDirection;
};
Telerik.Web.UI.RadSlidingZone.prototype={endUpdate:function(){
if(this._width.toString().indexOf("px")>-1){
this._width=parseInt(this._width,10);
}
if(this._height.toString().indexOf("px")>-1){
this._height=parseInt(this._height,10);
}
Telerik.Web.UI.RadSlidingZone.callBaseMethod(this,"endUpdate");
},dispose:function(){
var _2=this.getPanes();
for(var i=0,_4=_2.length;i<_4;i++){
_2[i]._moveRootToParent(true);
}
Telerik.Web.UI.RadSlidingZone.callBaseMethod(this,"dispose");
},initialize:function(){
Telerik.Web.UI.RadSlidingZone.callBaseMethod(this,"initialize");
this._splitterLoadedHandler=Function.createDelegate(this,this._splitterLoadedHandler);
this.get_splitter().add_loaded(this._splitterLoadedHandler);
},set_clickToOpen:function(_5){
this._clickToOpen=_5;
this.updateClientState();
},get_clickToOpen:function(){
return this._clickToOpen;
},set_resizeStep:function(_6){
this._resizeStep=_6;
this.updateClientState();
},get_resizeStep:function(){
return this._resizeStep;
},set_slideDuration:function(_7){
this._slideDuration=_7;
this.updateClientState();
},get_slideDuration:function(){
return this._slideDuration;
},get_width:function(){
return this._width;
},get_height:function(){
return this._height;
},get_expandedPaneId:function(){
return this._expandedPaneId;
},get_dockedPaneId:function(){
return this._dockedPaneId;
},get_splitter:function(){
return this._splitter;
},set_splitter:function(_8){
this._splitter=_8;
},add_loaded:function(_9){
this.get_events().addHandler("loaded",_9);
},remove_loaded:function(_a){
this.get_events().removeHandler("loaded",_a);
},getPaneById:function(_b){
return this._slidingPanesById[_b];
},getTabsContainer:function(){
return $get("RAD_SLIDING_ZONE_TABS_CONTAINER_"+this.get_id());
},dockPane:function(_c){
var _d=this.getPaneById(_c);
if(!_d||!_d.get_enableDock()){
return false;
}
_d._moveRootToParent(true);
var _e=new Telerik.Web.UI.PaneBeforeDockEventArgs();
_d.raiseEvent("beforeDock",_e);
if(_e.get_cancel()){
return false;
}
if(this._dockedPaneId){
if(!this.undockPane(this._dockedPaneId)){
return false;
}
}
this._dockingMode=true;
var _f=(this._isHorizontalSlide())?_d.get_width():_d.get_height();
var _10=this.get_splitter()._getAvailIncreaseDelta(this.get_parent()._indexInPanes,Telerik.Web.UI.SplitterDirection.Forward);
var _11=(this._isHorizontalSlide())?_d.get_minWidth():_d.get_minHeight();
if(_10<_11){
return false;
}
var _12=_f+this._getTabsContainerSize();
var _13=this.get_parent().getVarSize();
var _14=_13+_10;
var _15=Math.min(_14,_12);
var _16=_15-_13;
if(_16!=0){
var _17=(this.isLeftDirection()||this.isTopDirection())?Telerik.Web.UI.SplitterDirection.Backward:Telerik.Web.UI.SplitterDirection.Forward;
this.get_parent().resize(_16,_17);
}
_d._dock();
_d._setTabDockedState();
if(this._isVerticalSlide()){
var _18=_d.get_height()+this._getTabsContainerSize();
var _19=this.get_element();
$telerik.setOuterHeight(document.getElementById("RAD_SLIDING_ZONE_PANES_CONTAINER_"+this.get_id()),_d.get_height());
$telerik.setOuterHeight(_19,_18);
}
this._dockedPaneId=_c;
this.updateClientState();
this._dockingMode=false;
_d.raiseEvent("docked",new Telerik.Web.UI.PaneDockedEventArgs());
return true;
},undockPane:function(_1a){
var _1b=this.getPaneById(_1a);
if(!_1b){
return false;
}
_1b._moveRootToParent(false);
var _1c=new Telerik.Web.UI.PaneBeforeUndockEventArgs();
_1b.raiseEvent("beforeUndock",_1c);
if(_1c.get_cancel()){
return false;
}
if(!_1a){
_1a=this._dockedPaneId;
}
if(this.get_parent().get_collapsed()){
return false;
}
this._dockingMode=true;
_1b._undock();
this._dockedPaneId=null;
var _1d=this._getTabsContainerSize();
if(this._isVerticalSlide()){
var _1e=this.get_element();
$telerik.setOuterHeight(document.getElementById("RAD_SLIDING_ZONE_PANES_CONTAINER_"+this.get_id()),0);
$telerik.setOuterHeight(_1e,_1d);
}
var _1f=this.get_parent().getVarSize();
var _20=_1f-_1d;
var _21=(this.isLeftDirection()||this.isTopDirection())?Telerik.Web.UI.SplitterDirection.Backward:Telerik.Web.UI.SplitterDirection.Forward;
this.get_parent().resize(_20*(-1),_21);
_1b._setTabDefaultState();
this.updateClientState();
this._dockingMode=false;
_1b.raiseEvent("undocked",new Telerik.Web.UI.PaneUndockedEventArgs());
this._paneTabInMover=null;
return true;
},getPanes:function(){
return this._slidingPanes;
},expandPane:function(_22){
if(this._dockedPaneId==_22){
return false;
}
var _23=this.getPaneById(_22);
var _24=_23.getTabContainer();
if(!_23||!_24){
return false;
}
var _25=new Telerik.Web.UI.PaneBeforeExpandEventArgs();
_23.raiseEvent("beforeExpand",_25);
if(_25.get_cancel()){
return false;
}
_23._setTabExpandedState();
_23._expand();
this._expandedPaneId=_22;
this.updateClientState();
return true;
},collapsePane:function(_26,_27){
if(this._expandedPaneId!=_26){
return true;
}
if(this._dockedPaneId==_26){
return false;
}
var _28=this.getPaneById(_26);
var _29=_28.getTabContainer();
if(!_28||!_29){
return false;
}
_27=(_27)?true:false;
var _2a=new Telerik.Web.UI.PaneBeforeCollapseEventArgs();
_28.raiseEvent("beforeCollapse",_2a);
if(_2a.get_cancel()){
return false;
}
_28._setTabDefaultState();
_28._collapse();
this._expandedPaneId=null;
this.updateClientState();
return true;
},isLeftDirection:function(e){
return (this._slideDirection==Telerik.Web.UI.SplitterSlideDirection.Left);
},isRightDirection:function(){
return (this._slideDirection==Telerik.Web.UI.SplitterSlideDirection.Right);
},isTopDirection:function(){
return (this._slideDirection==Telerik.Web.UI.SplitterSlideDirection.Top);
},isBottomDirection:function(){
return (this._slideDirection==Telerik.Web.UI.SplitterSlideDirection.Bottom);
},_paneTab_OnMouseOver:function(e){
window.clearTimeout(this._paneTabMoutTimeout);
var _2d=e.target;
var _2e=this._getPaneIdFromTabElement(_2d);
if(!_2e){
return;
}
if(_2e==this._paneTabInMover){
return;
}
this._paneTabInMover=_2e;
if(!this._clickToOpen){
if(this._expandedPaneId!=null){
if(!this.collapsePane(this._expandedPaneId)){
return;
}
}
this.expandPane(_2e);
}
},_paneTab_OnMouseOut:function(e){
if(this._clickToOpen){
return;
}
var _30=e.target;
var _31=this._getPaneIdFromTabElement(_30);
if(!_31){
return;
}
var _32=this;
var f=function(){
_32._paneTabInMover=null;
_32.collapsePane(_31);
};
this._paneTabMoutTimeout=window.setTimeout(f,100);
},_paneTab_OnMouseDown:function(e){
if(!this._clickToOpen){
return;
}
var _35=e.target;
var _36=this._getPaneIdFromTabElement(_35);
if(this._expandedPaneId==_36){
this.collapsePane(_36);
}else{
if(this._expandedPaneId){
if(!this.collapsePane(this._expandedPaneId)){
return;
}
}
this.expandPane(_36);
}
},_isHorizontalSlide:function(){
return (this._slideDirection==Telerik.Web.UI.SplitterSlideDirection.Left||this._slideDirection==Telerik.Web.UI.SplitterSlideDirection.Right);
},_isVerticalSlide:function(){
return !this._isHorizontalSlide();
},_getPaneIdFromTabElement:function(_37){
while(_37&&_37.tagName!="DIV"){
_37=_37.parentNode;
}
if(!_37||_37.id.indexOf("RAD_SLIDING_PANE_TAB_")==-1){
return "";
}
return _37.id.substr("RAD_SLIDING_PANE_TAB_".length);
},_handleBeforeParentPaneResized:function(_38,_39){
if(this._dockingMode){
return;
}
var _3a=_39.get_delta();
if(this._dockedPaneId){
var _3b=this.getPaneById(this._dockedPaneId);
if(!_3b.get_enableResize()){
_39.set_cancel(true);
return;
}
var _3c=this._getTabsContainerSize();
var _3d=_3c+(this._isHorizontalSlide())?_3b.get_minWidth():_3b.get_minHeight();
var _3e=_3c+(this._isHorizontalSlide())?_3b.get_maxWidth():_3b.get_maxHeight();
var _3f=_3b.get_slidingPaneBounds();
var _40=(this._isHorizontalSlide())?_3f.width:_3f.height;
var _41=_40+_3a;
if(_41>_3e||_41<_3d){
_39.set_cancel(true);
return;
}
var _42=new Telerik.Web.UI.PaneBeforeResizeEventArgs(_3a);
_3b.raiseEvent("beforeResize",_42);
_39.set_cancel(_42.get_cancel());
}
},_getTabsContainerSize:function(){
var _43=this.getTabsContainer();
return (this._isHorizontalSlide())?_43.offsetWidth:_43.offsetHeight;
},_handleParentPaneResized:function(_44,_45){
if(this._dockingMode){
return;
}
if(!this._dockedPaneId){
return;
}
var _46=this.getPaneById(this._dockedPaneId);
if(!_46.get_enableResize()){
return;
}
var _47=_46.get_slidingPaneBounds();
var _48=_47.width;
var _49=_44.get_width()-_45.get_oldWidth();
var _4a=_48+_49;
var _4b=_47.height;
var _4c=_44.get_height()-_45.get_oldHeight();
var _4d=_4b+_4c;
_46._setSlidingContainerSize(_4a,_4d);
var _4e=_46.get_width();
var _4f=_45.get_oldHeight();
var _4d=_44.get_height();
_46.set_width(_4a);
_46.set_height(_4d);
if(this._isVerticalSlide()){
var _50=_4d;
var _51=this.get_element();
$telerik.setOuterHeight(_51,_50);
$telerik.setOuterHeight(document.getElementById("RAD_SLIDING_ZONE_PANES_CONTAINER_"+this.get_id()),_4d-this._getTabsContainerSize());
}
_46.raiseEvent("resized",new Telerik.Web.UI.PaneResizedEventArgs(_4e,_4f));
},_handleSplitterResized:function(_52,_53){
if(this._expandedPaneId){
if(_52.get_width()!=_53.get_oldWidth()||_52.get_height()!=_53.get_oldHeight()){
var _54=this._expandedPaneId;
this.collapsePane(_54);
this.expandPane(_54);
}
}
},_addPane:function(_55){
this._slidingPanes[this._slidingPanes.length]=_55;
this._slidingPanesById[_55.get_id()]=_55;
},_splitterLoadedHandler:function(){
$get("RAD_SLIDING_ZONE_PANES_CONTAINER_"+this.get_id()).style.display="";
this.get_parent().add_beforeResize(Function.createDelegate(this,this._handleBeforeParentPaneResized));
this.get_parent().add_resized(Function.createDelegate(this,this._handleParentPaneResized));
this.get_splitter().add_resized(Function.createDelegate(this,this._handleSplitterResized));
if(this._initiallyDockedPaneId!=null){
this.dockPane(this._initiallyDockedPaneId);
}
if(this._expandedPaneId!=null){
this.expandPane(this._expandedPaneId);
}
if(!this.isLeftDirection()&&Sys.Browser.agent==Sys.Browser.Firefox){
this.get_parent().getContentElement().style.overflow="";
}
this.updateClientState();
this.get_splitter().remove_loaded(this._splitterLoadedHandler);
this.raiseEvent("loaded");
},saveClientState:function(){
if(this.get_isUpdating()){
return;
}
var _56={"dockedPaneId":this._dockedPaneId||"","expandedPaneId":this._expandedPaneId||""};
var _57=["clickToOpen","resizeStep","slideDuration"];
for(var i=0,_59=_57.length;i<_59;i++){
var _5a=_57[i];
_56[_5a]=this["get_"+_5a]();
}
return Sys.Serialization.JavaScriptSerializer.serialize(_56);
}};
Telerik.Web.UI.RadSlidingZone.registerClass("Telerik.Web.UI.RadSlidingZone",Telerik.Web.UI.RadWebControl);

