Roo/bootstrap/NavSimplebar.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     loadMask : false,
31     
32     
33     getAutoCreate : function(){
34         
35         
36         throw { message : "nav bar is now a abstract base class - use SimpleBar / HeaderBar / SideBar etc..."};
37         
38     },
39     
40     initEvents :function ()
41     {
42         //Roo.log(this.el.select('.navbar-toggle',true));
43         this.el.select('.navbar-toggle',true).on('click', function() {
44            // Roo.log('click');
45             this.el.select('.navbar-collapse',true).toggleClass('in');                                 
46         }, this);
47         
48         var mark = {
49             tag: "div",
50             cls:"x-dlg-mask"
51         }
52         
53         this.maskEl = Roo.DomHelper.append(this.el, mark, true);
54         
55         var size = this.el.getSize();
56         this.maskEl.setSize(size.width, size.height);
57         this.maskEl.enableDisplayMode("block");
58         this.maskEl.hide();
59         
60         if(this.loadMask){
61             this.maskEl.show();
62         }
63     },
64     
65     
66     getChildContainer : function()
67     {
68         if (this.el.select('.collapse').getCount()) {
69             return this.el.select('.collapse',true).first();
70         }
71         
72         return this.el;
73     },
74     
75     mask : function()
76     {
77         this.maskEl.show();
78     },
79     
80     unmask : function()
81     {
82         this.maskEl.hide();
83     }
84     
85     
86     
87 });
88
89
90
91  
92
93