10 * @class Roo.bootstrap.Link
11 * @extends Roo.bootstrap.Component
12 * @children Roo.bootstrap.Component
13 * Bootstrap Link Class (eg. '<a href>')
15 * @cfg {String} alt image alternative text
16 * @cfg {String} href a tag href
17 * @cfg {String} target (_self|_blank|_parent|_top) target for a href.
18 * @cfg {String} html the content of the link.
19 * @cfg {String} anchor name for the anchor link
20 * @cfg {String} fa - favicon
22 * @cfg {Boolean} preventDefault (true | false) default false
27 * @param {Object} config The config object
30 Roo.bootstrap.Link = function(config){
31 Roo.bootstrap.Link.superclass.constructor.call(this, config);
37 * The img click event for the img.
38 * @param {Roo.EventObject} e
44 Roo.extend(Roo.bootstrap.Link, Roo.bootstrap.Component, {
48 preventDefault: false,
54 getAutoCreate : function()
56 var html = this.html || '';
58 if (this.fa !== false) {
59 html = '<i class="fa fa-' + this.fa + '"></i>';
64 // anchor's do not require html/href...
65 if (this.anchor === false) {
67 cfg.href = this.href || '#';
69 cfg.name = this.anchor;
70 if (this.html !== false || this.fa !== false) {
73 if (this.href !== false) {
78 if(this.alt !== false){
83 if(this.target !== false) {
84 cfg.target = this.target;
90 initEvents: function() {
92 if(!this.href || this.preventDefault){
93 this.el.on('click', this.onClick, this);
99 if(this.preventDefault){
102 //Roo.log('img onclick');
103 this.fireEvent('click', this, e);