Roo/bootstrap/Img.js
[roojs1] / Roo / bootstrap / Img.js
1 /*
2  * - LGPL
3  *
4  * page contgainer.
5  * 
6  */
7
8
9 /**
10  * @class Roo.bootstrap.ButtonGroup
11  * @extends Roo.bootstrap.Component
12  * Bootstrap ButtonGroup class
13  * @cfg {string} size lg | sm | xs (default empty normal)
14  * @cfg {string} align vertical | justified  (default none)
15  * @cfg {string} direction up | down (default down)
16  * 
17  * 
18  * @constructor
19  * Create a new Input
20  * @param {Object} config The config object
21  */
22
23 Roo.bootstrap.Img = function(config){
24     Roo.bootstrap.Img.superclass.constructor.call(this, config);
25 };
26
27 Roo.extend(Roo.bootstrap.Img, Roo.bootstrap.Component,  {
28     
29     imgResponsive: true,
30     border: '',
31     src: '',
32     
33     autoCreate : {
34         tag: 'img',
35         cls: 'img-responsive',
36         html : null
37     },
38
39     getAutoCreate : function(){
40         
41         var cfg = Roo.apply({}, Roo.bootstrap.Img.superclass.getAutoCreate.call(this));
42         
43         cfg.html = this.html || cfg.html;
44         
45         cfg.src = this.src || cfg.src;
46         
47         if (['rounded','circle','thumbnail'].indexOf(this.border)>-1) {
48             cfg.cls += ' img-' + this.border;
49         }
50         
51         if(this.alt){
52             cfg.alt = this.alt;
53         }
54         
55         return cfg;
56     }
57    
58 });
59
60