Roo/bootstrap/Navbar.js
[roojs1] / Roo / bootstrap / Navbar.js
1 /*
2  * - LGPL
3  *
4  * navbar
5  * 
6  */
7
8 /**
9  * @class Roo.bootstrap.Navbar
10  * @extends Roo.bootstrap.Component
11  * Bootstrap Navbar class
12
13  * @constructor
14  * Create a new Navbar
15  * @param {Object} config The config object
16  */
17
18
19 Roo.bootstrap.Navbar = function(config){
20     Roo.bootstrap.Navbar.superclass.constructor.call(this, config);
21     
22 };
23
24 Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component,  {
25     
26     
27    
28     // private
29     navItems : false,
30     
31     getAutoCreate : function(){
32         
33         
34         throw { message : "nav bar is now a abstract base class - use SimpleBar / HeaderBar / SideBar etc..."};
35         
36     },
37     
38     initEvents :function ()
39     {
40         //Roo.log(this.el.select('.navbar-toggle',true));
41         this.el.select('.navbar-toggle',true).on('click', function() {
42            // Roo.log('click');
43             this.el.select('.navbar-collapse',true).toggleClass('in');                                 
44         }, this);
45         
46         var mark = {
47             tag: "div",
48             cls:"x-dlg-mask"
49         }
50         
51         this.maskEl = Roo.DomHelper.append(this.el, mark, true);
52         
53         var size = this.el.getSize();
54         this.maskEl.setSize(size.width, size.height);
55         this.maskEl.enableDisplayMode("block");
56         this.maskEl.hide();
57         
58         if(this.loadMask){
59             this.maskEl.show();
60         }
61     },
62     
63     
64     getChildContainer : function()
65     {
66         if (this.el.select('.collapse').getCount()) {
67             return this.el.select('.collapse',true).first();
68         }
69         
70         return this.el;
71     },
72     
73     mask : function()
74     {
75         this.maskEl.show();
76     },
77     
78     unmask : function()
79     {
80         this.maskEl.hide();
81     }
82     
83     
84     
85 });
86
87
88
89  
90
91