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.
22 * @param {Object} config The config object
25 Roo.bootstrap.Img = function(config){
26 Roo.bootstrap.Img.superclass.constructor.call(this, config);
32 * The img click event for the img.
33 * @param {Roo.EventObject} e
39 Roo.extend(Roo.bootstrap.Img, Roo.bootstrap.Component, {
47 getAutoCreate : function(){
51 cls: (this.imgResponsive) ? 'img-responsive1' : '',
55 cfg.html = this.html || cfg.html;
57 cfg.src = this.src || cfg.src;
59 if (['rounded','circle','thumbnail'].indexOf(this.border)>-1) {
60 cfg.cls += ' img-' + this.border;
77 a.target = this.target;
83 return (this.href) ? a : cfg;
86 initEvents: function() {
89 this.el.on('click', this.onClick, this);
95 Roo.log('img onclick');
96 this.fireEvent('click', this, e);