roojs-bootstrap.js
[roojs1] / roojs-mailer-debug.js
index cec8343..2654b4b 100644 (file)
@@ -2,12 +2,10 @@
  * - LGPL
  *
  * element
- * <!-- BEGIN TEMPLATE // -->
-                       <table border="0" cellpadding="0" cellspacing="0" id="templateContainer">
-                               <tr>
-                               <td align="center" valign="top">
                               
  */
+Roo.mailer = Roo.mailer || {};
 
 /**
  * @class Roo.mailer.BodyContainer 
  * @param {Object} config The config object
  */
 
+_calls = 0;
+
 Roo.mailer.Body  = function(config){
     Roo.mailer.Body.superclass.constructor.call(this, config);
     //this.el = Roo.get(document.body);
-    
-    Roo.get(document.body).attr({
+    var body = Roo.get(document.body);
+    body.attr({
         leftmargin : 0,
         marginwidth : 0,
         topmargin : 0,
         marginheight : 0,
         offset : 0
     });
+    _calls++;
+    if (_calls > 1) {
+        throw "test";
+    }
+    
+    this.onRender(body);
+    this.onRender = function() { };
 
 };
 
@@ -79,9 +86,12 @@ Roo.extend(Roo.mailer.Body, Roo.bootstrap.Component,  {
         // add a child...
          
         return this.el.select('.roo-m-body-cell').first();
+    },
+    addxtype :   function (tree, cntr)
+    {
+        this.addxtypeChild(tree,cntr);
     }
-    
-    
+
     
     
    
@@ -106,7 +116,7 @@ Roo.extend(Roo.mailer.Body, Roo.bootstrap.Component,  {
  * Bootstrap Element class
  * @cfg {String} cls class of the element
  * @cfg {String} html content of header (not used for columns)
- * @cfg {String} blocktype  (header|preheader|footer|column-container)
+ * @cfg {String} blocktype  (header|preheader|footer|body|row)
  * 
  * @constructor
  * Create a new Element
@@ -130,7 +140,7 @@ Roo.extend(Roo.mailer.Block, Roo.bootstrap.Component,  {
             tag : 'tr',
             cls : 'roo-m-block-tr'
         }
-        if (this.blocktype != 'column-container') {
+        if (this.blocktype != 'row') {
            tr.cn = [
                 {
                     tag : 'td',
@@ -158,19 +168,19 @@ Roo.extend(Roo.mailer.Block, Roo.bootstrap.Component,  {
        
         return cfg;
     },
-    getChildContainer : function()
+    getChildContainer : function(build_call)
     {
         // add a child...
-        if (this.blogtype == 'column-container') {
-            var par = this.select(
-                        'roo-m-block-tr',true
+        if (this.blocktype == 'row' && build_call) {
+            var par = this.el.select(
+                        '.roo-m-block-tr',true
                     ).first();
             return par.createChild( {    
                     tag:  'td',
                     align : 'center',
                     valign : 'top',
                     style : 'padding-top : 20px;',
-                    cls : 'roo-m-column-container'
+                    cls : 'roo-m-row'
                 }
           
             );
@@ -226,8 +236,10 @@ Roo.extend(Roo.mailer.BodyContainer, Roo.bootstrap.Component,  {
             border : 0,
             cellpadding : 0,
             cellspacing : 0,
-            cls: 'roo-m-template-container ' + this.cls 
-            
+            cls: 'roo-m-body-container ' + this.cls,
+            cn : [
+                {  tag : 'tbody' }
+            ]
         };
         
         
@@ -237,7 +249,7 @@ Roo.extend(Roo.mailer.BodyContainer, Roo.bootstrap.Component,  {
     getChildContainer : function()
     {
         // add a child...
-        var tr = this.el.createChild({
+        var tr = this.el.select('tbody',true).first().createChild({
                     tag : 'tr',
                     cn : [
                         {   
@@ -312,7 +324,6 @@ Roo.extend(Roo.mailer.Column, Roo.bootstrap.Component,  {
             cellpadding :20,
             cellspacing : 0,
             width : '100%',
-           
             cn :  []
             
         };
@@ -324,7 +335,7 @@ Roo.extend(Roo.mailer.Column, Roo.bootstrap.Component,  {
                         tag : 'td',
                         align : 'center',
                         valight : 'top',
-                        cls : 'roo-m-column-left-content',
+                        cls : 'roo-m-column-'+ this.column + '-content',
                         cn : [
                             {
                                 tag : 'img',
@@ -345,7 +356,7 @@ Roo.extend(Roo.mailer.Column, Roo.bootstrap.Component,  {
                      tag : 'td',
                      align : 'center',
                      valight : 'top',
-                     cls : 'roo-m-column-left-content roo-m-column-body',
+                     cls : 'roo-m-column-'+ this.column + '-content roo-m-column-body',
                      html : this.html
                  }
              ]