allow string based values for comboboxarray
[roojs1] / Roo / bootstrap / Brick.js
index 6b233b1..425b22b 100644 (file)
@@ -139,13 +139,19 @@ Roo.extend(Roo.bootstrap.Brick, Roo.bootstrap.Component,  {
             this.el.on('mouseleave', this.leave, this);
         }
         
+        Roo.EventManager.onWindowResize(this.resize, this); 
+        
         if(this.bgimage.length){
             this.imageEl = this.el.select('.roo-brick-image-view', true).first();
-            this.imageEl.on('load', this.onBgLoad, this);
+            this.imageEl.on('load', this.onImageLoad, this);
+            return;
         }
         
-        Roo.EventManager.onWindowResize(this.resize, this); 
-        
+        this.resize();
+    },
+    
+    onImageLoad : function()
+    {
         this.resize();
     },
     
@@ -155,15 +161,14 @@ Roo.extend(Roo.bootstrap.Brick, Roo.bootstrap.Component,  {
         
         paragraph.setHeight(paragraph.getWidth() + paragraph.getPadding('tb'));
         
-        Roo.log("paragraph.getWidth() + paragraph.getPadding('tb')");
-        Roo.log(paragraph.getWidth() + paragraph.getPadding('tb'));
-        
         if(this.bgimage.length){
             var image = this.el.select('.roo-brick-image-view', true).first();
+            
             image.setWidth(paragraph.getWidth());
-//            image.setHeight(paragraph.getWidth());
-            Roo.log('image.getHeight()');
-            Roo.log(image.getHeight());
+            
+            if(this.square){
+                image.setHeight(paragraph.getWidth());
+            }
             
             this.el.setHeight(image.getHeight());
             paragraph.setHeight(image.getHeight());