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;
100 if(this.title.length){
104 cls: 'roo-brick-title',
111 if(this.html.length){
114 cls: 'roo-brick-text',
119 if(this.bgimage.length){
122 cls: 'roo-brick-image-view',
130 initEvents: function()
132 if(this.title.length || this.html.length){
133 this.el.on('mouseenter' ,this.enter, this);
134 this.el.on('mouseleave', this.leave, this);
138 Roo.EventManager.onWindowResize(this.resize, this);
145 var paragraph = this.el.select('.roo-brick-paragraph', true).first();
146 // paragraph.setHeight(paragraph.getWidth() + paragraph.getPadding('tb'));
147 paragraph.setHeight(paragraph.getWidth());
149 if(this.bgimage.length){
150 var image = this.el.select('.roo-brick-image-view', true).first();
151 image.setWidth(paragraph.getWidth());
152 image.setHeight(paragraph.getHeight());
157 enter: function(e, el)
161 if(this.bgimage.length){
162 this.el.select('.roo-brick-paragraph', true).first().setOpacity(0.9, true);
163 this.el.select('.roo-brick-image-view', true).first().setOpacity(0.1, true);
167 leave: function(e, el)
171 if(this.bgimage.length){
172 this.el.select('.roo-brick-paragraph', true).first().setOpacity(0, true);
173 this.el.select('.roo-brick-image-view', true).first().setOpacity(1, true);