sync
[roojs1] / Roo / bootstrap / Navbar.Item.js
1 /*
2  * - LGPL
3  *
4  * row
5  * 
6  */ 
7 Roo.bootstrap.Navbar.Item = function(config){
8     Roo.bootstrap.Navbar.Item.superclass.constructor.call(this, config);
9 };
10
11 Roo.extend(Roo.bootstrap.Navbar.Item, Roo.bootstrap.Component,  {
12     
13     href : false,
14     html : false,
15     badge : '',
16     
17     autoCreate : {
18         tag : 'li'
19     },
20     
21     getAutoCreate : function(){
22         
23         var cfg = Roo.apply({}, Roo.bootstrap.Navbar.Item.superclass.getAutoCreate.call(this));
24         cfg.cn = [
25             {
26                 tag: 'p',
27                 html: 'Text'
28             }
29         ];
30         
31         cfg.cn[0].html = this.html || cfg.cn[0].html ;
32         
33         if (!this.href) {
34             cfg.cn[0].tag='p';
35             cfg.cn[0].cls='navbar-text';
36         } else {
37             cfg.cn[0].tag='a';
38             cfg.cn[0].href=this.href;
39             cfg.cn[0].html=this.html;
40         }
41         
42         if (this.badge !== '') {
43             
44             cfg.cn[0].cn=[
45                 cfg.cn[0].html + ' ',
46                 {
47                     tag: 'span',
48                     cls: 'badge',
49                     html: this.badge
50                 }
51             ];
52             cfg.cn[0].html=''
53         }
54          
55         
56         return cfg;
57     }
58    
59 });
60
61  
62
63