9 * @class Roo.bootstrap.Brick
10 * @extends Roo.bootstrap.Component
11 * Bootstrap Brick class
15 * @param {Object} config The config object
18 Roo.bootstrap.Brick = function(config){
19 Roo.bootstrap.Brick.superclass.constructor.call(this, config);
25 * When a Brick is click
26 * @param {Roo.bootstrap.Brick} this
27 * @param {Roo.EventObject} e
33 Roo.extend(Roo.bootstrap.Brick, Roo.bootstrap.Component, {
44 * @cfg {String} bgimage
60 * @cfg {Boolean} square
64 getAutoCreate : function()
66 var cls = 'roo-brick';
69 cls += ' roo-brick-link';
72 if(this.bgimage.length){
73 cls += ' roo-brick-image';
77 cls += ' ' + this.cls;
81 tag: (this.href.length) ? 'a' : 'div',
86 cls: 'roo-brick-paragraph',
96 var cn = cfg.cn[0].cn;
98 if(this.title.length){
101 cls: 'roo-brick-title',
106 if(this.html.length){
109 cls: 'roo-brick-text',
114 if(this.bgimage.length){
117 cls: 'roo-brick-image-view',
125 initEvents: function()
127 this.el.on('mouseenter' ,this.enter, this);
128 this.el.on('mouseleave', this.leave, this);
130 Roo.EventManager.onWindowResize(this.resize, this);
137 var paragraph = this.el.select('.roo-brick-paragraph', true).first();
138 paragraph.setHeight(paragraph.getWidth() + paragraph.getPadding('tb'));
140 if(this.bgimage.length){
141 var image = this.el.select('.roo-brick-image-view', true).first();
142 image.setHeight(paragraph.getHeight())
147 enter: function(e, el)
151 if(this.bgimage.length){
152 this.el.select('.roo-brick-paragraph', true).first().setOpacity(0.9, true);
156 leave: function(e, el)
160 if(this.bgimage.length){
161 this.el.select('.roo-brick-paragraph', true).first().setOpacity(0, true);