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;
};
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(){
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(_2){
this._clickToOpen=_2;
this.updateClientState();
},get_clickToOpen:function(){
return this._clickToOpen;
},set_resizeStep:function(_3){
this._resizeStep=_3;
this.updateClientState();
},get_resizeStep:function(){
return this._resizeStep;
},set_slideDuration:function(_4){
this._slideDuration=_4;
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(_5){
this._splitter=_5;
},add_loaded:function(_6){
this.get_events().addHandler("loaded",_6);
},remove_loaded:function(_7){
this.get_events().removeHandler("loaded",_7);
},getPaneById:function(_8){
return this._slidingPanesById[_8];
},getTabsContainer:function(){
return $get("RAD_SLIDING_ZONE_TABS_CONTAINER_"+this.get_id());
},dockPane:function(_9){
var _a=this.getPaneById(_9);
if(!_a||!_a.get_enableDock()){
return false;
}
var _b=new Telerik.Web.UI.PaneBeforeDockEventArgs();
_a.raiseEvent("beforeDock",_b);
if(_b.get_cancel()){
return false;
}
if(this._dockedPaneId){
if(!this.undockPane(this._dockedPaneId)){
return false;
}
}
this._dockingMode=true;
var _c=(this._isHorizontalSlide())?_a.get_width():_a.get_height();
var _d=this.get_splitter()._getAvailIncreaseDelta(this.get_parent()._indexInPanes,Telerik.Web.UI.SplitterDirection.Forward);
var _e=(this._isHorizontalSlide())?_a.get_minWidth():_a.get_minHeight();
if(_d<_e){
return false;
}
var _f=_c+this._getTabsContainerSize();
var _10=this.get_parent().getVarSize();
var _11=_10+_d;
var _12=Math.min(_11,_f);
var _13=_12-_10;
if(_13!=0){
var _14=(this.isLeftDirection()||this.isTopDirection())?Telerik.Web.UI.SplitterDirection.Backward:Telerik.Web.UI.SplitterDirection.Forward;
this.get_parent().resize(_13,_14);
}
_a._dock();
_a._setTabDockedState();
if(this._isVerticalSlide()){
var _15=_a.get_height()+this._getTabsContainerSize();
var _16=this.get_element();
$telerik.setOuterHeight(document.getElementById("RAD_SLIDING_ZONE_PANES_CONTAINER_"+this.get_id()),_a.get_height());
$telerik.setOuterHeight(_16,_15);
}
this._dockedPaneId=_9;
this.updateClientState();
this._dockingMode=false;
_a.raiseEvent("docked",new Telerik.Web.UI.PaneDockedEventArgs());
return true;
},undockPane:function(_17){
var _18=this.getPaneById(_17);
if(!_18){
return false;
}
var _19=new Telerik.Web.UI.PaneBeforeUndockEventArgs();
_18.raiseEvent("beforeUndock",_19);
if(_19.get_cancel()){
return false;
}
if(!_17){
_17=this._dockedPaneId;
}
if(this.get_parent().get_collapsed()){
return false;
}
this._dockingMode=true;
_18._undock();
this._dockedPaneId=null;
var _1a=this._getTabsContainerSize();
if(this._isVerticalSlide()){
var _1b=this.get_element();
$telerik.setOuterHeight(document.getElementById("RAD_SLIDING_ZONE_PANES_CONTAINER_"+this.get_id()),0);
$telerik.setOuterHeight(_1b,_1a);
}
var _1c=this.get_parent().getVarSize();
var _1d=_1c-_1a;
var _1e=(this.isLeftDirection()||this.isTopDirection())?Telerik.Web.UI.SplitterDirection.Backward:Telerik.Web.UI.SplitterDirection.Forward;
this.get_parent().resize(_1d*(-1),_1e);
_18._setTabDefaultState();
this.updateClientState();
this._dockingMode=false;
_18.raiseEvent("undocked",new Telerik.Web.UI.PaneUndockedEventArgs());
this._paneTabInMover=null;
return true;
},getPanes:function(){
return this._slidingPanes;
},expandPane:function(_1f){
if(this._dockedPaneId==_1f){
return false;
}
var _20=this.getPaneById(_1f);
var _21=_20.getTabContainer();
if(!_20||!_21){
return false;
}
var _22=new Telerik.Web.UI.PaneBeforeExpandEventArgs();
_20.raiseEvent("beforeExpand",_22);
if(_22.get_cancel()){
return false;
}
_20._setTabExpandedState();
_20._expand();
this._expandedPaneId=_1f;
this.updateClientState();
return true;
},collapsePane:function(_23,_24){
if(this._expandedPaneId!=_23){
return true;
}
if(this._dockedPaneId==_23){
return false;
}
var _25=this.getPaneById(_23);
var _26=_25.getTabContainer();
if(!_25||!_26){
return false;
}
_24=(_24)?true:false;
var _27=new Telerik.Web.UI.PaneBeforeCollapseEventArgs();
_25.raiseEvent("beforeCollapse",_27);
if(_27.get_cancel()){
return false;
}
_25._setTabDefaultState();
_25._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 _2a=e.target;
var _2b=this._getPaneIdFromTabElement(_2a);
if(!_2b){
return;
}
if(_2b==this._paneTabInMover){
return;
}
this._paneTabInMover=_2b;
if(!this._clickToOpen){
if(this._expandedPaneId!=null){
if(!this.collapsePane(this._expandedPaneId)){
return;
}
}
this.expandPane(_2b);
}
},_paneTab_OnMouseOut:function(e){
if(this._clickToOpen){
return;
}
var _2d=e.target;
var _2e=this._getPaneIdFromTabElement(_2d);
if(!_2e){
return;
}
var _2f=this;
var f=function(){
_2f._paneTabInMover=null;
_2f.collapsePane(_2e);
};
this._paneTabMoutTimeout=window.setTimeout(f,100);
},_paneTab_OnMouseDown:function(e){
if(!this._clickToOpen){
return;
}
var _32=e.target;
var _33=this._getPaneIdFromTabElement(_32);
if(this._expandedPaneId==_33){
this.collapsePane(_33);
}else{
if(this._expandedPaneId){
if(!this.collapsePane(this._expandedPaneId)){
return;
}
}
this.expandPane(_33);
}
},_isHorizontalSlide:function(){
return (this._slideDirection==Telerik.Web.UI.SplitterSlideDirection.Left||this._slideDirection==Telerik.Web.UI.SplitterSlideDirection.Right);
},_isVerticalSlide:function(){
return !this._isHorizontalSlide();
},_getPaneIdFromTabElement:function(_34){
while(_34&&_34.tagName!="DIV"){
_34=_34.parentNode;
}
if(!_34||_34.id.indexOf("RAD_SLIDING_PANE_TAB_")==-1){
return "";
}
return _34.id.substr("RAD_SLIDING_PANE_TAB_".length);
},_handleBeforeParentPaneResized:function(_35,_36){
if(this._dockingMode){
return;
}
var _37=_36.get_delta();
if(this._dockedPaneId){
var _38=this.getPaneById(this._dockedPaneId);
if(!_38.get_enableResize()){
_36.set_cancel(true);
return;
}
var _39=this._getTabsContainerSize();
var _3a=_39+(this._isHorizontalSlide())?_38.get_minWidth():_38.get_minHeight();
var _3b=_39+(this._isHorizontalSlide())?_38.get_maxWidth():_38.get_maxHeight();
var _3c=(this._isHorizontalSlide())?_38._slidingContainerWidth:_38._slidingContainerHeight;
var _3d=_3c+_37;
if(_3d>_3b||_3d<_3a){
_36.set_cancel(true);
return;
}
var _3e=new Telerik.Web.UI.PaneBeforeResizeEventArgs(_37);
_38.raiseEvent("beforeResize",_3e);
_36.set_cancel(_3e.get_cancel());
}
},_getTabsContainerSize:function(){
var _3f=this.getTabsContainer();
return (this._isHorizontalSlide())?_3f.offsetWidth:_3f.offsetHeight;
},_handleParentPaneResized:function(_40,_41){
if(this._dockingMode){
return;
}
if(!this._dockedPaneId){
return;
}
var _42=this.getPaneById(this._dockedPaneId);
if(!_42.get_enableResize()){
_41.set_cancel(true);
}
var _43=_42._slidingContainerWidth;
var _44=_40.get_width()-_41.get_oldWidth();
var _45=_43+_44;
var _46=_42._slidingContainerHeight;
var _47=_40.get_height()-_41.get_oldHeight();
var _48=_46+_47;
_42._setSlidingContainerSize(_45,_48);
var _49=_42.get_width();
var _4a=_41.get_oldHeight();
var _48=_40.get_height();
_42.set_width(_45);
_42.set_height(_48);
if(this._isVerticalSlide()){
var _4b=_48;
var _4c=this.get_element();
$telerik.setOuterHeight(_4c,_4b);
$telerik.setOuterHeight(document.getElementById("RAD_SLIDING_ZONE_PANES_CONTAINER_"+this.get_id()),_48-this._getTabsContainerSize());
}
_42.raiseEvent("resized",new Telerik.Web.UI.PaneResizedEventArgs(_49,_4a));
},_handleSplitterResized:function(_4d,_4e){
if(this._expandedPaneId){
if(_4d.get_width()!=_4e.get_oldWidth()||_4d.get_height()!=_4e.get_oldHeight()){
var _4f=this._expandedPaneId;
this.collapsePane(_4f);
this.expandPane(_4f);
}
}
},_addPane:function(_50){
this._slidingPanes[this._slidingPanes.length]=_50;
this._slidingPanesById[_50.get_id()]=_50;
},_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 _51={"dockedPaneId":this._dockedPaneId||"","expandedPaneId":this._expandedPaneId||""};
var _52=["clickToOpen","resizeStep","slideDuration"];
for(var i=0;i<_52.length;i++){
_51[_52[i]]=this["get_"+_52[i]]();
}
return Sys.Serialization.JavaScriptSerializer.serialize(_51);
}};
$telerik.makeCompatible(Telerik.Web.UI.RadSlidingZone);
Telerik.Web.UI.RadSlidingZone.registerClass("Telerik.Web.UI.RadSlidingZone",Telerik.Web.UI.RadWebControl);

