Fix #6922 - replace builder to with @parent builder
[roojs1] / Roo / bootstrap / layout / Border.js
index 12c0f65..d467725 100644 (file)
@@ -11,6 +11,8 @@
 /**
  * @class Roo.bootstrap.layout.Border
  * @extends Roo.bootstrap.layout.Manager
+ * @children Roo.bootstrap.panel.Content Roo.bootstrap.panel.Nest Roo.bootstrap.panel.Grid
+ * @parent builder Roo.bootstrap.panel.Nest Roo.bootstrap.panel.Nest Roo.bootstrap.Modal
  * This class represents a common layout manager used in desktop applications. For screenshots and more details,
  * please see: examples/bootstrap/nested.html<br><br>
  
@@ -25,11 +27,9 @@ the container size if it is not the body element.</b>
  */
 Roo.bootstrap.layout.Border = function(config){
     config = config || {};
+    Roo.bootstrap.layout.Border.superclass.constructor.call(this, config);
     
-    Roo.log('Border construct!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
-    Roo.log(config);
     
-    Roo.bootstrap.layout.Border.superclass.constructor.call(this, config);
     
     Roo.each(Roo.bootstrap.layout.Border.regions, function(region) {
         if(config[region]){
@@ -40,9 +40,31 @@ Roo.bootstrap.layout.Border = function(config){
     
 };
 
-Roo.bootstrap.layout.Border.regions =  ["north","south","east","west","center"];
+Roo.bootstrap.layout.Border.regions =  ["center", "north","south","east","west"];
 
 Roo.extend(Roo.bootstrap.layout.Border, Roo.bootstrap.layout.Manager, {
+    
+       /**
+        * @cfg {Roo.bootstrap.layout.Region} center region to go in center
+        */
+       /**
+        * @cfg {Roo.bootstrap.layout.Region} west region to go in west
+        */
+       /**
+        * @cfg {Roo.bootstrap.layout.Region} east region to go in east
+        */
+       /**
+        * @cfg {Roo.bootstrap.layout.Region} south region to go in south
+        */
+       /**
+        * @cfg {Roo.bootstrap.layout.Region} north region to go in north
+        */
+       
+       
+       
+       
+    parent : false, // this might point to a 'nest' or a ???
+    
     /**
      * Creates and adds a new region if it doesn't already exist.
      * @param {String} target The target region key (north, south, east, west or center).
@@ -51,7 +73,6 @@ Roo.extend(Roo.bootstrap.layout.Border, Roo.bootstrap.layout.Manager, {
      */
     addRegion : function(config)
     {
-        Roo.log('add region!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
         if(!this.regions[config.region]){
             var r = this.factory(config);
            this.bindRegion(r);
@@ -60,10 +81,7 @@ Roo.extend(Roo.bootstrap.layout.Border, Roo.bootstrap.layout.Manager, {
     },
 
     // private (kinda)
-    bindRegion : function(r)
-    {
-        Roo.log('bind region!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
-        
+    bindRegion : function(r){
         this.regions[r.config.region] = r;
         
         r.on("visibilitychange",    this.layout, this);
@@ -301,13 +319,18 @@ layout.addxtype({
             delete cfg.items;
         }
         var nb = false;
+       
+       if ( region == 'center') {
+           Roo.log("Center: " + cfg.title);
+       }
+       
         
         switch(cfg.xtype) 
         {
             case 'Content':  // ContentPanel (el, cfg)
             case 'Scroll':  // ContentPanel (el, cfg)
             case 'View': 
-                cfg.autoCreate = true;
+                cfg.autoCreate = cfg.autoCreate || true;
                 ret = new cfg.xns[cfg.xtype](cfg); // new panel!!!!!
                 //} else {
                 //    var el = this.el.createChild();
@@ -457,7 +480,7 @@ layout.addxtype({
         cfg.mgr = this;
         
         var r = Roo.bootstrap.layout;
-        
+        Roo.log(target);
         switch(target){
             case "north":
                 return new r.North(cfg);