10 * @class Roo.bootstrap.Img
11 * @extends Roo.bootstrap.Component
13 * @cfg {Boolean} imgResponsive false | true
14 * @cfg {String} border rounded | circle | thumbnail
15 * @cfg {String} src image source
16 * @cfg {String} alt image alternative text
17 * @cfg {String} href a tag href
18 * @cfg {String} target (_self|_blank|_parent|_top)target for a href.
19 * @cfg {String} xsUrl xs image source
20 * @cfg {String} smUrl sm image source
21 * @cfg {String} mdUrl md image source
22 * @cfg {String} lgUrl lg image source
26 * @param {Object} config The config object
29 Roo.bootstrap.Img = function(config){
30 Roo.bootstrap.Img.superclass.constructor.call(this, config);
36 * The img click event for the img.
37 * @param {Roo.EventObject} e
43 Roo.extend(Roo.bootstrap.Img, Roo.bootstrap.Component, {
55 getAutoCreate : function()
58 this.createSingleImg();
63 createSingleImg : function()
67 cls: (this.imgResponsive) ? 'img-responsive' : '',
71 cfg.html = this.html || cfg.html;
73 cfg.src = this.src || cfg.src;
75 if (['rounded','circle','thumbnail'].indexOf(this.border)>-1) {
76 cfg.cls += ' img-' + this.border;
93 a.target = this.target;
98 return (this.href) ? a : cfg;
101 initEvents: function() {
104 this.el.on('click', this.onClick, this);
108 onClick : function(e)
110 Roo.log('img onclick');
111 this.fireEvent('click', this, e);