cls += ' roo-brick-image';
}
+ if(!this.html.length && !this.bgimage.length){
+ cls += ' roo-brick-center-title';
+ }
+
+ if(!this.html.length && this.bgimage.length){
+ cls += ' roo-brick-bottom-title';
+ }
+
if(this.cls){
cls += ' ' + this.cls;
}
var cn = cfg.cn[0].cn;
- Roo.log(this.title);
-
if(this.title.length){
- Roo.log('run???');
cn.push({
tag: 'h4',
cls: 'roo-brick-title',
});
}
- Roo.log(cn);
-
if(this.html.length){
cn.push({
tag: 'p',
cls: 'roo-brick-text',
html: this.html
});
+ } else {
+ cn.cls += ' hide';
}
if(this.bgimage.length){
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.onImageLoad, this);
+ return;
+ }
+
+ this.resize();
+ },
+
+ onImageLoad : function()
+ {
this.resize();
},
resize : function()
{
var paragraph = this.el.select('.roo-brick-paragraph', true).first();
-// paragraph.setHeight(paragraph.getWidth() + paragraph.getPadding('tb'));
- paragraph.setHeight(paragraph.getWidth());
+
+ paragraph.setHeight(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.getHeight());
+
+ if(this.square){
+ image.setHeight(paragraph.getWidth());
+ }
+
+ this.el.setHeight(image.getHeight());
+ paragraph.setHeight(image.getHeight());
+
}
},