Forked mumble-django project from https://bitbucket.org/Svedrin/mumble-django
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8 lines
14 KiB

  1. /*
  2. * Ext JS Library 2.2
  3. * Copyright(c) 2006-2008, Ext JS, LLC.
  4. * licensing@extjs.com
  5. *
  6. * http://extjs.com/license
  7. */
  8. Ext.layout.BorderLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,rendered:false,onLayout:function(B,X){var C;if(!this.rendered){X.position();X.addClass("x-border-layout-ct");var M=B.items.items;C=[];for(var Q=0,R=M.length;Q<R;Q++){var U=M[Q];var F=U.region;if(U.collapsed){C.push(U)}U.collapsed=false;if(!U.rendered){U.cls=U.cls?U.cls+" x-border-panel":"x-border-panel";U.render(X,Q)}this[F]=F!="center"&&U.split?new Ext.layout.BorderLayout.SplitRegion(this,U.initialConfig,F):new Ext.layout.BorderLayout.Region(this,U.initialConfig,F);this[F].render(X,U)}this.rendered=true}var L=X.getViewSize();if(L.width<20||L.height<20){if(C){this.restoreCollapsed=C}return }else{if(this.restoreCollapsed){C=this.restoreCollapsed;delete this.restoreCollapsed}}var J=L.width,S=L.height;var I=J,P=S,G=0,H=0;var N=this.north,K=this.south,E=this.west,T=this.east,U=this.center;if(!U){throw"No center region defined in BorderLayout "+B.id}if(N&&N.isVisible()){var W=N.getSize();var O=N.getMargins();W.width=J-(O.left+O.right);W.x=O.left;W.y=O.top;G=W.height+W.y+O.bottom;P-=G;N.applyLayout(W)}if(K&&K.isVisible()){var W=K.getSize();var O=K.getMargins();W.width=J-(O.left+O.right);W.x=O.left;var V=(W.height+O.top+O.bottom);W.y=S-V+O.top;P-=V;K.applyLayout(W)}if(E&&E.isVisible()){var W=E.getSize();var O=E.getMargins();W.height=P-(O.top+O.bottom);W.x=O.left;W.y=G+O.top;var A=(W.width+O.left+O.right);H+=A;I-=A;E.applyLayout(W)}if(T&&T.isVisible()){var W=T.getSize();var O=T.getMargins();W.height=P-(O.top+O.bottom);var A=(W.width+O.left+O.right);W.x=J-A+O.left;W.y=G+O.top;I-=A;T.applyLayout(W)}var O=U.getMargins();var D={x:H+O.left,y:G+O.top,width:I-(O.left+O.right),height:P-(O.top+O.bottom)};U.applyLayout(D);if(C){for(var Q=0,R=C.length;Q<R;Q++){C[Q].collapse(false)}}if(Ext.isIE&&Ext.isStrict){X.repaint()}},destroy:function(){var B=["north","south","east","west"];for(var A=0;A<B.length;A++){var C=this[B[A]];if(C&&C.split){C.split.destroy(true)}}Ext.layout.BorderLayout.superclass.destroy.call(this)}});Ext.layout.BorderLayout.Region=function(B,A,C){Ext.apply(this,A);this.layout=B;this.position=C;this.state={};if(typeof this.margins=="string"){this.margins=this.layout.parseMargins(this.margins)}this.margins=Ext.applyIf(this.margins||{},this.defaultMargins);if(this.collapsible){if(typeof this.cmargins=="string"){this.cmargins=this.layout.parseMargins(this.cmargins)}if(this.collapseMode=="mini"&&!this.cmargins){this.cmargins={left:0,top:0,right:0,bottom:0}}else{this.cmargins=Ext.applyIf(this.cmargins||{},C=="north"||C=="south"?this.defaultNSCMargins:this.defaultEWCMargins)}}};Ext.layout.BorderLayout.Region.prototype={collapsible:false,split:false,floatable:true,minWidth:50,minHeight:50,defaultMargins:{left:0,top:0,right:0,bottom:0},defaultNSCMargins:{left:5,top:5,right:5,bottom:5},defaultEWCMargins:{left:5,top:0,right:5,bottom:0},isCollapsed:false,render:function(B,C){this.panel=C;C.el.enableDisplayMode();this.targetEl=B;this.el=C.el;var A=C.getState,D=this.position;C.getState=function(){return Ext.apply(A.call(C)||{},this.state)}.createDelegate(this);if(D!="center"){C.allowQueuedExpand=false;C.on({beforecollapse:this.beforeCollapse,collapse:this.onCollapse,beforeexpand:this.beforeExpand,expand:this.onExpand,hide:this.onHide,show:this.onShow,scope:this});if(this.collapsible){C.collapseEl="el";C.slideAnchor=this.getSlideAnchor()}if(C.tools&&C.tools.toggle){C.tools.toggle.addClass("x-tool-collapse-"+D);C.tools.toggle.addClassOnOver("x-tool-collapse-"+D+"-over")}}},getCollapsedEl:function(){if(!this.collapsedEl){if(!this.toolTemplate){var B=new Ext.Template("<div class=\"x-tool x-tool-{id}\">&#160;</div>");B.disableFormats=true;B.compile();Ext.layout.BorderLayout.Region.prototype.toolTemplate=B}this.collapsedEl=this.targetEl.createChild({cls:"x-layout-collapsed x-layout-collapsed-"+this.position,id:this.panel.id+"-xcollapsed"});this.collapsedEl.enableDisplayMode("block");if(this.collapseMode=="mini"){this.collapsedEl.addClass("x-layout-cmini-"+this.position);this.miniCollapsedEl=this.collapsedEl.createChild({cls:"x-layout-mini x-layout-mini-"+this.pos