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
18 * @cfg {String} fa - favicon
20 * @cfg {Boolean} preventDefault (true | false) default false
25 * @param {Object} config The config object
28 Roo.bootstrap.Link = function(config){
29 Roo.bootstrap.Link.superclass.constructor.call(this, config);
35 * The img click event for the img.
36 * @param {Roo.EventObject} e
42 Roo.extend(Roo.bootstrap.Link, Roo.bootstrap.Component, {
46 preventDefault: false,
52 getAutoCreate : function()
54 var html = this.html || '';
56 if (this.fa !== false) {
57 html = '<i class="fa fa-' + this.fa + '"></i>';
62 // anchor's do not require html/href...
63 if (this.anchor === false) {
65 cfg.href = this.href || '#';
67 cfg.name = this.anchor;
68 if (this.html !== false || this.fa !== false) {
71 if (this.href !== false) {
76 if(this.alt !== false){
81 if(this.target !== false) {
82 cfg.target = this.target;
88 initEvents: function() {
90 if(!this.href || this.preventDefault){
91 this.el.on('click', this.onClick, this);
97 if(this.preventDefault){
100 //Roo.log('img onclick');
101 this.fireEvent('click', this, e);