Roo/mailer/Body.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 _calls = 0;
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     _calls++;
35     if (_calls > 1) {
36         throw "test";
37     }
38     
39     this.onRender(body);
40     this.onRender = function() { };
41
42 };
43
44 Roo.extend(Roo.mailer.Body, Roo.bootstrap.Component,  {
45     
46     
47     cls: '',
48      
49     
50     getAutoCreate : function(){
51         
52         var cfg ={
53             tag : 'center',
54             cn : [
55                 {
56                     tag: 'table',
57                     border : 0,
58                     cellpadding : 0,
59                     cellspacing : 0,
60                     height : '100%',
61                     align : 'center',
62                     cls: 'roo-m-body-table ' + this.cls,
63                     
64                     cn : [
65                         {
66                             tag : 'tr',
67                             cn : [
68                                 {
69                                     tag : 'td',
70                                     align : 'center',
71                                     valight : 'top',
72                                     cls : 'roo-m-body-cell'
73                                 }
74                             ]
75                         }
76                     ]
77                 }
78             ]
79         };
80          
81         
82         return cfg;
83     },
84     getChildContainer : function()
85     {
86         // add a child...
87          
88         return this.el.select('.roo-m-body-cell').first();
89     }
90     
91     
92     
93     
94    
95 });
96
97  
98
99