sync
[roojs1] / Roo / bootstrap / panel / Nest.js
index 689afb4..9256dd6 100644 (file)
@@ -1,15 +1,14 @@
 
 /**
- * @class Roo.boostrap.panel.Nest
- * @extends Roo.ContentPanel
+ * @class Roo.bootstrap.panel.Nest
+ * @extends Roo.bootstrap.panel.Content
  * @constructor
- * Create a new NestedLayoutPanel.
+ * Create a new Panel, that can contain a layout.Border.
  * 
  * 
- * @param {Roo.BorderLayout} layout The layout for this panel
  * @param {String/Object} config A string to set only the title or a config object
  */
-Roo.NestedLayoutPanel = function(layout, config)
+Roo.bootstrap.panel.Nest = function(config)
 {
     // construct with only one argument..
     /* FIXME - implement nicer consturctors
@@ -24,25 +23,35 @@ Roo.NestedLayoutPanel = function(layout, config)
     }
     */
     
+    config.el =  config.layout.getEl();
     
-    Roo.NestedLayoutPanel.superclass.constructor.call(this, layout.getEl(), config);
+    Roo.bootstrap.panel.Nest.superclass.constructor.call(this, config);
     
-    layout.monitorWindowResize = false; // turn off autosizing
-    this.layout = layout;
-    this.layout.getEl().addClass("x-layout-nested-layout");
+    config.layout.monitorWindowResize = false; // turn off autosizing
+    this.layout = config.layout;
+    this.layout.getEl().addClass("roo-layout-nested-layout");
+    this.layout.parent = this;
     
     
     
     
 };
 
-Roo.extend(Roo.NestedLayoutPanel, Roo.ContentPanel, {
+Roo.extend(Roo.bootstrap.panel.Nest, Roo.bootstrap.panel.Content, {
+    /**
+    * @cfg {Roo.BorderLayout} layout The layout for this panel
+    */
+    layout : false,
 
     setSize : function(width, height){
         if(!this.ignoreResize(width, height)){
             var size = this.adjustForComponents(width, height);
             var el = this.layout.getEl();
-            el.setSize(size.width, size.height);
+            if (size.height < 1) {
+                el.setWidth(size.width);   
+            } else {
+                el.setSize(size.width, size.height);
+            }
             var touch = el.dom.offsetWidth;
             this.layout.layout();
             // ie requires a double layout on the first pass
@@ -57,6 +66,8 @@ Roo.extend(Roo.NestedLayoutPanel, Roo.ContentPanel, {
     
     setActiveState : function(active){
         this.active = active;
+        this.setActiveClass(active);
+        
         if(!active){
             this.fireEvent("deactivate", this);
             return;