10 * @class Roo.bootstrap.Link
11 * @extends Roo.bootstrap.Component
12 * Bootstrap Link Class
13 * @cfg {String} alt image alternative text
14 * @cfg {String} href a tag href
15 * @cfg {String} target (_self|_blank|_parent|_top) target for a href.
16 * @cfg {String} html the content of the link.
17 * @cfg {String} anchor name for the anchor link
19 * @cfg {Boolean} preventDefault (true | false) default false
24 * @param {Object} config The config object
27 Roo.bootstrap.Link = function(config){
28 Roo.bootstrap.Link.superclass.constructor.call(this, config);
34 * The img click event for the img.
35 * @param {Roo.EventObject} e
41 Roo.extend(Roo.bootstrap.Link, Roo.bootstrap.Component, {
45 preventDefault: false,
49 getAutoCreate : function()
56 // anchor's do not require html/href...
57 if (this.anchor === false) {
58 cfg.html = this.html || 'html-missing';
59 cfg.href = this.href || '#';
61 cfg.name = this.anchor;
62 if (this.html !== false) {
65 if (this.href !== false) {
70 if(this.alt !== false){
75 if(this.target) !== false) {
76 cfg.target = this.target;
82 initEvents: function() {
84 if(!this.href || this.preventDefault){
85 this.el.on('click', this.onClick, this);
91 if(this.preventDefault){
94 //Roo.log('img onclick');
95 this.fireEvent('click', this, e);