Roo/bootstrap/Body.js
[roojs1] / Roo / bootstrap / Body.js
1 /*
2  * - LGPL
3  *
4  * Body
5  *
6  */
7
8 /**
9  * @class Roo.bootstrap.Body
10  * @extends Roo.bootstrap.Component
11  * Bootstrap Body class
12  *
13  * @constructor
14  * Create a new body
15  * @param {Object} config The config object
16  * @cfg {DomElement} do_render - if this is set, then the constructor will try and initialize render, using this as the start point
17  
18  */
19
20 Roo.bootstrap.Body = function(config){
21
22     config = config || {};
23
24     Roo.bootstrap.Body.superclass.constructor.call(this, config);
25     this.el = Roo.get(config.el ? config.el : document.body );
26     if (this.cls && this.cls.length) {
27         Roo.get(document.body).addClass(this.cls);
28     }
29     if (config.do_render) {
30         this.onRender(config.do_render, '');
31         this.xaddChildren(config.items);
32     }
33     
34 };
35
36 Roo.extend(Roo.bootstrap.Body, Roo.bootstrap.Component,  {
37
38     do_render : false,
39     is_body : true,// just to make sure it's constructed?
40
41     autoCreate : {
42         cls: 'container'
43     },
44     onRender : function(ct, position)
45     {
46         if (!this.do_render) {
47             return;
48         }
49         this.el = Roo.get(this.do_render);
50         /* Roo.log("Roo.bootstrap.Body - onRender");
51         if (this.cls && this.cls.length) {
52             Roo.get(document.body).addClass(this.cls);
53         }
54         // style??? xttr???
55         */
56     }
57
58
59
60
61 });