From f12ecaf4757430abe01a879e815346951fd45705 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 18 Sep 2014 17:20:09 +0800 Subject: [PATCH] roojs-core.js roojs-core-debug.js roojs-ui.js roojs-ui-debug.js roojs-mailer.js roojs-mailer-debug.js --- roojs-mailer-debug.js | 34 +++++++++++++++++----------------- roojs-mailer.js | 6 +++--- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/roojs-mailer-debug.js b/roojs-mailer-debug.js index 83de51dd6d..1ce2525b74 100644 --- a/roojs-mailer-debug.js +++ b/roojs-mailer-debug.js @@ -2,12 +2,10 @@ * - LGPL * * element - * - - -
+ */ +Roo.mailer = Roo.mailer || {}; /** * @class Roo.mailer.BodyContainer @@ -20,19 +18,19 @@ * @param {Object} config The config object */ -Roo.mailer = Roo.mailer || {}; 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 }); + this.onRender(body); }; @@ -108,7 +106,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|body|olumn-container) + * @cfg {String} blocktype (header|preheader|footer|body|row) * * @constructor * Create a new Element @@ -132,7 +130,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', @@ -160,19 +158,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' } ); @@ -228,8 +226,10 @@ Roo.extend(Roo.mailer.BodyContainer, Roo.bootstrap.Component, { border : 0, cellpadding : 0, cellspacing : 0, - cls: 'roo-m-body-container ' + this.cls - + cls: 'roo-m-body-container ' + this.cls, + cn : [ + { tag : 'tbody' } + ] }; @@ -239,7 +239,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 : [ { diff --git a/roojs-mailer.js b/roojs-mailer.js index 538cc4df01..92b67b527b 100644 --- a/roojs-mailer.js +++ b/roojs-mailer.js @@ -1,9 +1,9 @@ //Roo/mailer/Body.js -Roo.mailer=Roo.mailer||{};Roo.mailer.Body=function(A){Roo.mailer.Body.superclass.constructor.call(this,A);Roo.get(document.body).attr({leftmargin:0,marginwidth:0,topmargin:0,marginheight:0,offset:0});};Roo.extend(Roo.mailer.Body,Roo.bootstrap.Component,{cls:'',getAutoCreate:function(){var A={tag:'center',cn:[{tag:'table',border:0,cellpadding:0,cellspacing:0,height:'100%',align:'center',cls:'roo-m-body-table '+this.cls,cn:[{tag:'tr',cn:[{tag:'td',align:'center',valight:'top',cls:'roo-m-body-cell'}]}]}]};return A;},getChildContainer:function(){return this.el.select('.roo-m-body-cell').first();}}); +Roo.mailer=Roo.mailer||{};Roo.mailer.Body=function(A){Roo.mailer.Body.superclass.constructor.call(this,A);var B=Roo.get(document.body);B.attr({leftmargin:0,marginwidth:0,topmargin:0,marginheight:0,offset:0});this.onRender(B);};Roo.extend(Roo.mailer.Body,Roo.bootstrap.Component,{cls:'',getAutoCreate:function(){var A={tag:'center',cn:[{tag:'table',border:0,cellpadding:0,cellspacing:0,height:'100%',align:'center',cls:'roo-m-body-table '+this.cls,cn:[{tag:'tr',cn:[{tag:'td',align:'center',valight:'top',cls:'roo-m-body-cell'}]}]}]};return A;},getChildContainer:function(){return this.el.select('.roo-m-body-cell').first();}}); //Roo/mailer/Block.js -Roo.mailer.Block=function(A){Roo.mailer.Block.superclass.constructor.call(this,A);};Roo.extend(Roo.mailer.Block,Roo.bootstrap.Component,{cls:'',html:'',blocktype:'header',getAutoCreate:function(){var tr={tag:'tr',cls:'roo-m-block-tr'};if(this.blocktype!='column-container'){tr.cn=[{tag:'td',align:'center',valight:'top',cls:'roo-m-'+this.blocktype+'-content',html:this.html}]}var cfg={tag:'table',border:0,cellpadding:0,cellspacing:0,width:'100%',align:'center',cls:'roo-m-'+this.blocktype+' '+this.cls,cn:[tr]};return cfg;},getChildContainer:function(){if(this.blogtype=='column-container'){var A=this.select('roo-m-block-tr',true).first();return A.createChild({tag:'td',align:'center',valign:'top',style:'padding-top : 20px;',cls:'roo-m-column-container'});}return this.el.select('.roo-m-'+this.blocktype+'-content',true).first();}}); +Roo.mailer.Block=function(A){Roo.mailer.Block.superclass.constructor.call(this,A);};Roo.extend(Roo.mailer.Block,Roo.bootstrap.Component,{cls:'',html:'',blocktype:'header',getAutoCreate:function(){var tr={tag:'tr',cls:'roo-m-block-tr'};if(this.blocktype!='row'){tr.cn=[{tag:'td',align:'center',valight:'top',cls:'roo-m-'+this.blocktype+'-content',html:this.html}]}var cfg={tag:'table',border:0,cellpadding:0,cellspacing:0,width:'100%',align:'center',cls:'roo-m-'+this.blocktype+' '+this.cls,cn:[tr]};return cfg;},getChildContainer:function(A){if(this.blocktype=='row'&&A){var B=this.el.select('.roo-m-block-tr',true).first();return B.createChild({tag:'td',align:'center',valign:'top',style:'padding-top : 20px;',cls:'roo-m-row'});}return this.el.select('.roo-m-'+this.blocktype+'-content',true).first();}}); //Roo/mailer/BodyContainer.js -Roo.mailer.BodyContainer=function(A){Roo.mailer.BodyContainer.superclass.constructor.call(this,A);};Roo.extend(Roo.mailer.BodyContainer,Roo.bootstrap.Component,{cls:'',getAutoCreate:function(){var A={tag:'table',border:0,cellpadding:0,cellspacing:0,cls:'roo-m-body-container '+this.cls};return A;},getChildContainer:function(){var tr=this.el.createChild({tag:'tr',cn:[{tag:'td',align:'center',valign:'top',cls:'roo-m-child-ctr'}]});return tr.select('.roo-m-child-ctr').first();}}); +Roo.mailer.BodyContainer=function(A){Roo.mailer.BodyContainer.superclass.constructor.call(this,A);};Roo.extend(Roo.mailer.BodyContainer,Roo.bootstrap.Component,{cls:'',getAutoCreate:function(){var A={tag:'table',border:0,cellpadding:0,cellspacing:0,cls:'roo-m-body-container '+this.cls,cn:[{tag:'tbody'}]};return A;},getChildContainer:function(){var tr=this.el.select('tbody',true).first().createChild({tag:'tr',cn:[{tag:'td',align:'center',valign:'top',cls:'roo-m-child-ctr'}]});return tr.select('.roo-m-child-ctr').first();}}); //Roo/mailer/Column.js Roo.mailer.Column=function(A){Roo.mailer.Column.superclass.constructor.call(this,A);};Roo.extend(Roo.mailer.Column,Roo.bootstrap.Component,{cls:'',html:'',src:'',column:'left',getAutoCreate:function(){var tr={tag:'tr',cn:[]};var cfg={tag:'table',border:0,cellpadding:20,cellspacing:0,width:'100%',cn:[]};if(this.src!=''){cfg.cn.push({tag:'tr',cn:[{tag:'td',align:'center',valight:'top',cls:'roo-m-column-'+this.column+'-content',cn:[{tag:'img',src:this.src,cls:'roo-m-column-image',style:'max-width: 260px;'}]}]});} cfg.cn.push({tag:'tr',cn:[{tag:'td',align:'center',valight:'top',cls:'roo-m-column-'+this.column+'-content roo-m-column-body',html:this.html}]});return cfg;},getChildContainer:function(){return this.el.select('.roo-m-column-body',true).first();}}); -- 2.39.2