roojs-core.js
[roojs1] / Roo / mailer / Body.js
1 /*
2  * - LGPL
3  *
4  * element
5  
6                               
7  */
8 Roo.mailer = Roo.mailer || {};
9
10 /**
11  * @class Roo.mailer.BodyContainer 
12  * @extends Roo.bootstrap.Component
13  * Bootstrap Element class
14  * @cfg {String} cls class of the element
15  * 
16  * @constructor
17  * Create a new Element
18  * @param {Object} config The config object
19  */
20
21
22
23 Roo.mailer.Body  = function(config){
24     Roo.mailer.Body.superclass.constructor.call(this, config);
25     //this.el = Roo.get(document.body);
26     var body = Roo.get(document.body);
27     body.attr({
28         leftmargin : 0,
29         marginwidth : 0,
30         topmargin : 0,
31         marginheight : 0,
32         offset : 0
33     });
34     Roo.mailer.Body._calls++;
35     if (Roo.mailer.Body._calls > 1) {
36         return;
37         throw "test";
38     }
39     
40     this.onRender(body);
41     this.onRender = function() { };
42
43 };
44
45 Roo.mailer.Body._calls = 0;
46
47 Roo.extend(Roo.mailer.Body, Roo.bootstrap.Component,  {
48     
49     
50     cls: '',
51      
52     
53     getAutoCreate : function(){
54         
55         var cfg ={
56             tag : 'center',
57             cn : [
58                 {
59                     tag: 'table',
60                     border : 0,
61                     cellpadding : 0,
62                     cellspacing : 0,
63                     height : '100%',
64                     align : 'center',
65                     cls: 'roo-m-body-table ' + this.cls,
66                     
67                     cn : [
68                         {
69                             tag : 'tr',
70                             cn : [
71                                 {
72                                     tag : 'td',
73                                     align : 'center',
74                                     valight : 'top',
75                                     cls : 'roo-m-body-cell'
76                                 }
77                             ]
78                         }
79                     ]
80                 }
81             ]
82         };
83          
84         
85         return cfg;
86     },
87     getChildContainer : function()
88     {
89         // add a child...
90          
91         return this.el.select('.roo-m-body-cell').first();
92     },
93     addxtype :   function (tree, cntr)
94     {
95         return this.addxtypeChild(tree,cntr);
96     }
97
98     
99     
100    
101 });
102
103  
104
105