﻿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._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.get_splitter().add_Loaded(Function.createDelegate(this,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.Web.UI.Box.SetOuterHeight(document.getElementById("RAD_SLIDING_ZONE_PANES_CONTAINER_"+this.get_id()),_a.get_Height());
Telerik.Web.UI.Box.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.Web.UI.Box.SetOuterHeight(document.getElementById("RAD_SLIDING_ZONE_PANES_CONTAINER_"+this.get_id()),0);
Telerik.Web.UI.Box.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("PaneUndocked",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())?Telerik.Web.UI.Box.GetOuterWidth(_3f):Telerik.Web.UI.Box.GetOuterHeight(_3f);
},_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.Web.UI.Box.SetOuterHeight(_4c,_4b);
Telerik.Web.UI.Box.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._dockedPaneId!=null){
this.dockPane(this._dockedPaneId);
}
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.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.Web.UI.RadSlidingZone.registerClass("Telerik.Web.UI.RadSlidingZone",Telerik.Web.UI.RadWebControl);


if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();