Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.SplitBarCollapseMode=function(){
};
Telerik.Web.UI.SplitBarCollapseMode.prototype={None:1,Forward:2,Backward:3,Both:4};
Telerik.Web.UI.SplitBarCollapseMode.registerEnum("Telerik.Web.UI.SplitBarCollapseMode",false);
Telerik.Web.UI.RadSplitBar=function(_1){
Telerik.Web.UI.RadSplitBar.initializeBase(this,[_1]);
this._collapseMode=Telerik.Web.UI.SplitBarCollapseMode.None;
this._enableResize=true;
this._resizeStep=0;
this._indexInSplitBars=0;
this._prevPane=null;
this._nextPane=null;
this._collapsed={};
this._collapsed[Telerik.Web.UI.SplitterDirection.Forward]=false;
this._collapsed[Telerik.Web.UI.SplitterDirection.Backward]=false;
};
Telerik.Web.UI.RadSplitBar.prototype={initialize:function(){
Telerik.Web.UI.RadSplitBar.callBaseMethod(this,"initialize");
this.get_splitter()._addSplitBar(this);
var _2=Telerik.Web.UI.SplitterDirection.Forward;
if(this.isCollapseDirectionEnabled(_2)){
var _3=this.getCollapseBarElement(_2);
$addHandlers(_3,{"mousedown":this._collapseBarFwdOnMouseDown,"mouseover":this._collapseBarFwdOnMouseOver,"mouseout":this._collapseBarFwdOnMouseOut},this);
}
var _2=Telerik.Web.UI.SplitterDirection.Backward;
if(this.isCollapseDirectionEnabled(_2)){
var _3=this.getCollapseBarElement(_2);
$addHandlers(_3,{"mousedown":this._collapseBarBackOnMouseDown,"mouseover":this._collapseBarBackOnMouseOver,"mouseout":this._collapseBarBackOnMouseOut},this);
}
if(this.get_enableResize()){
var _4=this.get_element();
$addHandlers(_4,{"mousedown":this._onMouseDown,"mouseover":this._onMouseOver,"mouseout":this._onMouseOut},this);
}
this._setCursorStyle();
this._splitterLoadedHandler=Function.createDelegate(this,this._splitterLoadedHandler);
this.get_splitter().add_loaded(this._splitterLoadedHandler);
},dispose:function(){
var _5=Telerik.Web.UI.SplitterDirection.Forward;
if(this.isCollapseDirectionEnabled(_5)){
var _6=this.getCollapseBarElement(_5);
$clearHandlers(_6);
}
var _5=Telerik.Web.UI.SplitterDirection.Backward;
if(this.isCollapseDirectionEnabled(_5)){
var _6=this.getCollapseBarElement(_5);
$clearHandlers(_6);
}
if(this.get_enableResize()){
var _7=this.get_element();
$clearHandlers(_7);
}
Telerik.Web.UI.RadSplitBar.callBaseMethod(this,"dispose");
},endUpdate:function(){
Telerik.Web.UI.RadSplitBar.callBaseMethod(this,"endUpdate");
},set_collapseMode:function(_8){
this._collapseMode=_8;
},get_collapseMode:function(){
return this._collapseMode;
},set_resizeStep:function(_9){
this._resizeStep=_9;
},get_resizeStep:function(){
this._resizeStep;
},set_enableResize:function(_a){
this._enableResize=_a;
},get_enableResize:function(){
return this._enableResize;
},set_nextPane:function(_b){
this._nextPane=_b;
},get_nextPane:function(_c){
return this._nextPane;
},set_prevPane:function(_d){
this._prevPane=_d;
},get_prevPane:function(_e){
return this._prevPane;
},get_splitter:function(){
return this._parent;
},isCollapseDirectionEnabled:function(_f){
if(this._collapseMode==Telerik.Web.UI.SplitBarCollapseMode.Both){
return true;
}
if(_f==Telerik.Web.UI.SplitterDirection.Forward&&this._collapseMode==Telerik.Web.UI.SplitBarCollapseMode.Forward){
return true;
}
if(_f==Telerik.Web.UI.SplitterDirection.Backward&&this._collapseMode==Telerik.Web.UI.SplitBarCollapseMode.Backward){
return true;
}
return false;
},getCollapseBarElement:function(_10){
var _11="Forward";
if(_10==Telerik.Web.UI.SplitterDirection.Backward){
_11="Backward";
}
return $get("RAD_SPLITTER_BAR_COLLAPSE_"+_11+"_"+this.get_id());
},isCollapsed:function(_12){
return this._collapsed[_12];
},getWidth:function(){
return this.get_element().offsetWidth;
},getHeight:function(){
return this.get_element().offsetHeight;
},_collapseBarFwdOnMouseOut:function(e){
e.stopPropagation();
var _14=this.getCollapseBarElement(Telerik.Web.UI.SplitterDirection.Forward);
var _15=this._collapsed[Telerik.Web.UI.SplitterDirection.Forward];
_14.className=(this.get_splitter().isVertical())?((!_15)?"collapseBarCollapse":"collapseBarExpand"):((!_15)?"collapseBarHorizontalCollapse":"collapseBarHorizontalExpand");
return false;
},_collapseBarFwdOnMouseOver:function(e){
e.stopPropagation();
var _17=this.getCollapseBarElement(Telerik.Web.UI.SplitterDirection.Forward);
var _18=this._collapsed[Telerik.Web.UI.SplitterDirection.Forward];
_17.className=(this.get_splitter().isVertical())?((!_18)?"collapseBarCollapseOver":"collapseBarExpandOver"):((!_18)?"collapseBarHorizontalCollapseOver":"collapseBarHorizontalExpandOver");
this._setHorizontalWrapperWidth();
return false;
},_collapseBarFwdOnMouseDown:function(e){
if(e.button&&e.button!=1){
return true;
}
e.preventDefault();
e.stopPropagation();
this._collapseTargetPane(Telerik.Web.UI.SplitterDirection.Forward);
var _1a=this;
var _1b=function(){
_1a._collapseBarFwdOnMouseOut(e);
};
setTimeout(_1b,10);
return false;
},_collapseBarBackOnMouseOut:function(e){
e.stopPropagation();
var _1d=this.getCollapseBarElement(Telerik.Web.UI.SplitterDirection.Backward);
var _1e=this._collapsed[Telerik.Web.UI.SplitterDirection.Backward];
_1d.className=(this.get_splitter().isVertical())?((!_1e)?"collapseBarExpand":"collapseBarCollapse"):((!_1e)?"collapseBarHorizontalExpand":"collapseBarHorizontalCollapse");
return false;
},_collapseBarBackOnMouseOver:function(e){
e.stopPropagation();
var _20=this.getCollapseBarElement(Telerik.Web.UI.SplitterDirection.Backward);
var _21=this._collapsed[Telerik.Web.UI.SplitterDirection.Backward];
_20.className=(this.get_splitter().isVertical())?((!_21)?"collapseBarExpandOver":"collapseBarCollapseOver"):((!_21)?"collapseBarHorizontalExpandOver":"collapseBarHorizontalCollapseOver");
this._setHorizontalWrapperWidth();
return false;
},_collapseBarBackOnMouseDown:function(e){
if(e.button&&e.button!=1){
return true;
}
e.preventDefault();
e.stopPropagation();
this._collapseTargetPane(Telerik.Web.UI.SplitterDirection.Backward);
var _23=this;
var _24=function(){
_23._collapseBarBackOnMouseOut(e);
};
setTimeout(_24,10);
return false;
},_onMouseDown:function(e){
e.preventDefault();
e.stopPropagation();
if(this.isCollapsed(Telerik.Web.UI.SplitterDirection.Forward)||this.isCollapsed(Telerik.Web.UI.SplitterDirection.Backward)){
return false;
}
this._maxDecreaseDelta=this._getAvailDecreaseDelta();
this._maxIncreaseDelta=this._getAvailIncreaseDelta();
var _26=this.get_element();
var pos=$telerik.getLocation(_26);
this._mouseStartX=e.clientX;
this._mouseStartY=e.clientY;
this._targetResizePane=this.get_splitter()._getAvailAdjacentPane(this._prevPane._indexInPanes+1,Telerik.Web.UI.SplitterDirection.Backward);
if(this._targetResizePane==null){
return false;
}
this._liveResMouseX=e.clientX;
this._liveResMouseY=e.clientY;
this._liveResPaneStartSize=this._targetResizePane.getVarSize();
this._mouseOffsetX=e.clientX-pos.x;
this._mouseOffsetY=e.clientY-pos.y;
this._handlerStartLeftPos=pos.x;
this._handlerStartTopPos=pos.y;
this._currentDelta=0;
this._onMouseUpDelegate=Function.createDelegate(this,this._onMouseUp);
this._onMouseMoveDelegate=Function.createDelegate(this,this._onMouseMove);
$addHandler(document,"mouseup",this._onMouseUpDelegate);
$addHandler(document,"mousemove",this._onMouseMoveDelegate);
return false;
},_onMouseMove:function(e){
e.preventDefault();
e.stopPropagation();
var _29=0;
if(this.get_splitter().isVertical()){
_29=e.clientX-this._mouseStartX;
}else{
_29=e.clientY-this._mouseStartY;
}
var _2a=150;
if(!this._helperBar){
var _2b=document.createElement("TABLE");
_2b.className=this.get_splitter().getContainerElement().className;
_2b.style.borderCollapse="separate";
_2b.cellSpacing=_2a;
_2b.cellPadding=0;
_2b.style.borderWidth="0px";
_2b.style.background="";
_2b.style.cursor=this._getCursorStyle();
var _2c=document.createElement("TBODY");
_2b.appendChild(_2c);
var TR=document.createElement("TR");
_2c.appendChild(TR);
var TD=document.createElement("TD");
TR.appendChild(TD);
var _2f=document.createElement("DIV");
_2f.className="helperBarDrag";
_2f.style.width=this.getWidth()-this.get_splitter()._borderSize*(this.get_splitter().isVertical()?1:0)+"px";
_2f.style.height=Math.ceil(this.getHeight()-this.get_splitter()._borderSize*(!this.get_splitter().isVertical()?1:1/2))+"px";
TD.appendChild(_2f);
_2b.style.position="absolute";
var _30=0;
var _31=0;
if(!document.all&&this.get_splitter().isNested()){
if(this.get_splitter().isVertical()){
_31+=2;
}else{
_30+=2;
}
}
_2b.style.left=this._handlerStartLeftPos-_2a+_30+"px";
_2b.style.top=this._handlerStartTopPos-_2a+_31+"px";
_2b.style.zIndex=1;
this._helperBar=document.body.insertBefore(_2b,document.body.firstChild);
this._helperBarDecoration=_2f;
}
var _32=false;
if(_29<((-1)*this._maxDecreaseDelta)){
_32=true;
_29=this._maxDecreaseDelta*(-1);
}
if(_29>this._maxIncreaseDelta){
_32=true;
_29=this._maxIncreaseDelta;
}
if(this._resizeStep>0&&!this.get_splitter().get_liveResize()){
_29-=_29%this._resizeStep;
}
this._helperBarDecoration.className="helperBarDrag";
if(this.get_splitter().isVertical()){
this._helperBar.style.left=this._handlerStartLeftPos-_2a+this.get_splitter()._borderSize/2+_29+"px";
}else{
this._helperBar.style.top=this._handlerStartTopPos-_2a+this.get_splitter()._borderSize/2+_29+"px";
}
if(!this.get_splitter().get_liveResize()){
this._currentDelta=_29;
}
if(_32){
if(this._helperBarDecoration){
this._helperBarDecoration.className="helperBarError";
}
if(!this.get_splitter().get_liveResize()){
return false;
}
}
if(this.get_splitter().get_liveResize()){
var _33=32;
if(this._lastUpdate&&((new Date()-this._lastUpdate)<_33)){
return false;
}
this._lastUpdate=new Date();
if(this.get_splitter().isVertical()){
_29=e.clientX-this._liveResMouseX;
}else{
_29=e.clientY-this._liveResMouseY;
}
this._liveResMouseX=e.clientX;
this._liveResMouseY=e.clientY;
var _34=_29;
if(_32){
var _35=this._liveResPaneStartSize;
var _36=this._targetResizePane.getVarSize();
var _37=(this.get_splitter().isVertical())?(this._liveResMouseX-this._mouseStartX):(this._liveResMouseY-this._mouseStartY);
if(_37>0){
_34=this._maxIncreaseDelta-(_36-_35);
}else{
_34=this._maxDecreaseDelta-(_35-_36);
_34*=-1;
}
if(_34==0){
return;
}
}
this._targetResizePane.resize(_34,Telerik.Web.UI.SplitterDirection.Forward);
}
return false;
},_onMouseUp:function(e){
e.preventDefault();
e.stopPropagation();
$removeHandler(document,"mouseup",this._onMouseUpDelegate);
$removeHandler(document,"mousemove",this._onMouseMoveDelegate);
if(this._helperBar){
this._helperBar.parentNode.removeChild(this._helperBar);
this._helperBar=null;
}
if(!this.get_splitter().get_liveResize()&&this._currentDelta!=0){
this._targetResizePane.resize(this._currentDelta,Telerik.Web.UI.SplitterDirection.Forward);
}
return false;
},_onMouseOver:function(e){
if(!this._isInactive){
var _3a=this.get_element();
_3a.className=(this.get_splitter().isVertical())?"resizeBarOver":"resizeBarOverHorizontal";
}
},_onMouseOut:function(e){
if(!this._isInactive){
var _3c=this.get_element();
_3c.className=(this.get_splitter().isVertical())?"resizeBar":"resizeBarHorizontal";
}
},_setCursorStyle:function(){
var _3d=this.get_element();
_3d.style.cursor=this._getCursorStyle();
},_getCursorStyle:function(){
if(!this.get_enableResize()){
return "";
}
if(this.get_splitter().isVertical()){
return "w-resize";
}else{
return "n-resize";
}
},_getCollapseTarget:function(_3e){
return (_3e==Telerik.Web.UI.SplitterDirection.Forward)?this._prevPane:this._nextPane;
},_getAvailDecreaseDelta:function(){
var _3f=this.get_splitter()._getAvailAdjacentPane(this._prevPane._indexInPanes+1,Telerik.Web.UI.SplitterDirection.Backward);
if(_3f==null){
return 0;
}
var _40=0;
_40=_3f._getAvailDecreaseDelta();
if(_40<=0){
return 0;
}
var _41=this.get_splitter()._getAvailIncreaseDelta(_3f._indexInPanes,Telerik.Web.UI.SplitterDirection.Forward);
return Math.min(_41,_40);
},_getAvailIncreaseDelta:function(){
var _42=this.get_splitter()._getAvailAdjacentPane(this._prevPane._indexInPanes+1,Telerik.Web.UI.SplitterDirection.Backward);
if(_42==null){
return 0;
}
var _43=0;
_43=_42._getAvailIncreaseDelta();
if(_43<=0){
return 0;
}
var _44=this.get_splitter()._getAvailDecreaseDelta(_42._indexInPanes,Telerik.Web.UI.SplitterDirection.Forward);
return Math.min(_44,_43);
},_getCollapseBarHeight:function(_45){
if(this.getCollapseBarElement(_45)==null){
return 0;
}
return this.getCollapseBarElement(_45).offsetHeight;
},_getCollapseDivClass:function(_46){
var _47=(this.get_splitter().isVertical())?"collapseBarCollapse":"collapseBarHorizontalCollapse";
if(_46==Telerik.Web.UI.SplitterDirection.Backward){
_47=(this.get_splitter().isVertical())?"collapseBarExpand":"collapseBarHorizontalExpand";
}
return _47;
},_getExpandDivClass:function(_48){
var _49=(this.get_splitter().isVertical())?"collapseBarExpand":"collapseBarHorizontalExpand";
if(_48==Telerik.Web.UI.SplitterDirection.Backward){
_49=(this.get_splitter().isVertical())?"collapseBarCollapse":"collapseBarHorizontalCollapse";
}
return _49;
},_collapseTargetPane:function(_4a){
var _4b=this._getCollapseTarget(_4a);
if(!_4b){
return false;
}
if(_4b.isLocked()){
this._showExpandCollapseError(_4a);
return false;
}
var _4c=this.getCollapseBarElement(_4a);
var _4d=this.get_element();
var _4e=false;
if(this.isCollapsed(_4a)){
if(_4b.get_collapsed()){
if(this.get_splitter()._expandPane(_4b,_4a)){
if(_4c!=null){
_4c.className=this._getCollapseDivClass(_4a);
}
this._setActive();
this._collapsed[_4a]=false;
_4e=true;
}else{
this._showExpandCollapseError(_4a);
}
}
}else{
if(!_4b.get_collapsed()){
if(this.get_splitter()._collapsePane(_4b,_4a)){
if(_4c!=null){
_4c.className=this._getExpandDivClass(_4a);
}
this._setInactive();
this._collapsed[_4a]=true;
_4e=true;
}else{
this._showExpandCollapseError(_4a);
}
}
}
if(_4e){
var _4f=(_4a==Telerik.Web.UI.SplitterDirection.Forward)?Telerik.Web.UI.SplitterDirection.Backward:Telerik.Web.UI.SplitterDirection.Forward;
var _50=this.getCollapseBarElement(_4f);
if(_50!=null){
_50.style.display=(_4b.get_collapsed())?"none":"";
}
this._setHorizontalWrapperWidth();
}
return _4e;
},_showExpandCollapseError:function(_51){
var _52=this.getCollapseBarElement(_51);
if(_52==null){
return;
}
var _53=(this.get_splitter().isVertical())?((_51==Telerik.Web.UI.SplitterDirection.Forward)?"collapseBarCollapse":"collapseBarExpand"):((_51==Telerik.Web.UI.SplitterDirection.Forward)?"collapseBarHorizontalCollapse":"collapseBarHorizontalExpand");
var _54=(this.get_splitter().isVertical())?((_51==Telerik.Web.UI.SplitterDirection.Forward)?"collapseBarCollapseError":"collapseBarExpandError"):((_51==Telerik.Web.UI.SplitterDirection.Forward)?"collapseBarHorizontalCollapseError":"collapseBarHorizontalExpandError");
setTimeout(function(){
setCollapseBarCss(_54);
},0);
setTimeout(function(){
setCollapseBarCss(_53);
},200);
setTimeout(function(){
setCollapseBarCss(_54);
},400);
setTimeout(function(){
setCollapseBarCss(_53);
},600);
setTimeout(function(){
setCollapseBarCss(_54);
},800);
setTimeout(function(){
setCollapseBarCss(_53);
},1000);
function setCollapseBarCss(_55){
_52.className=_55;
}
},_splitterLoadedHandler:function(){
var _56=this.get_splitter()._getSplitBarsSize()/this.get_splitter().getSplitBars().length;
var _57=$get("RAD_SPLITBAR_SPACER_"+this.get_id());
if(this.get_splitter().isVertical()){
$telerik.setOuterWidth(this.get_element(),_56);
if(_57){
_57.style.width=_56+"px";
}
}else{
$telerik.setOuterHeight(this.get_element(),_56);
if(_57){
_57.style.height=_56+"px";
}
this._setHorizontalWrapperWidth();
}
this.get_splitter().remove_loaded(this._splitterLoadedHandler);
},_setHorizontalWrapperWidth:function(){
if(this.get_splitter().isVertical()){
return;
}
var _58=$get("RAD_SPLITTER_BAR_COLLAPSE_WRAPPER_"+this.get_id());
if(_58){
var _59=0;
var _5a=this.getCollapseBarElement(Telerik.Web.UI.SplitterDirection.Forward);
if(_5a!=null){
_59+=_5a.offsetWidth;
}
_5a=this.getCollapseBarElement(Telerik.Web.UI.SplitterDirection.Backward);
if(_5a!=null){
_59+=_5a.offsetWidth;
}
if(_59){
_58.style.width=_59+"px";
}
}
},_setActive:function(){
var _5b=this.get_element();
this._setCursorStyle();
_5b.className=(this.get_splitter().isVertical())?"resizeBar":"resizeBarHorizontal";
this._isInactive=false;
},_setInactive:function(){
var _5c=this.get_element();
_5c.style.cursor="";
var _5d=(this.get_splitter().isVertical())?"resizeBarInactive":"resizeBarInactiveHorizontal";
_5c.className=(this.get_splitter().isVertical())?"resizeBarInactive":"resizeBarInactiveHorizontal";
this._isInactive=true;
}};
$telerik.makeCompatible(Telerik.Web.UI.RadSplitBar);
Telerik.Web.UI.RadSplitBar.registerClass("Telerik.Web.UI.RadSplitBar",Telerik.Web.UI.SplitterItem);

