roojs-mailer.js
authoredward <edward@roojs.com>
Fri, 18 Sep 2015 04:15:29 +0000 (12:15 +0800)
committeredward <edward@roojs.com>
Fri, 18 Sep 2015 04:15:29 +0000 (12:15 +0800)
roojs-mailer-debug.js

roojs-mailer-debug.js
roojs-mailer.js

index 4cf6054..c0e560e 100644 (file)
@@ -291,6 +291,7 @@ Roo.extend(Roo.mailer.BodyContainer, Roo.bootstrap.Component,  {
  * @cfg {String} html content of body
  * @cfg {String} src image url
  * @cfg {String} column  (left|right)
+ * @cfg {String width (100%|200|340|260)
  * 
  * @constructor
  * Create a new Element
@@ -308,6 +309,7 @@ Roo.extend(Roo.mailer.Column, Roo.bootstrap.Component,  {
     html : '',
     src : '',
     column : 'left',
+    width : '100%',
      
     getAutoCreate : function(){
                                             
@@ -323,11 +325,21 @@ Roo.extend(Roo.mailer.Column, Roo.bootstrap.Component,  {
             border : 0,
             cellpadding :20,
             cellspacing : 0,
-            width : '100%',
+            width : this.width,
             cn :  []
             
         };
         if (this.src != '') {
+            var img = {
+                tag : 'img',
+                src : this.src,
+                cls : 'roo-m-column-image',
+                
+                style : 'max-width: ' + (this.width== '100%' ?  '260' : this.width ) +'px;'
+            };
+            if (this.width != '100%' ) {
+                img.width = this.width;
+            }
            cfg.cn.push({
                 tag  : 'tr',
                 cn : [
@@ -336,14 +348,8 @@ Roo.extend(Roo.mailer.Column, Roo.bootstrap.Component,  {
                         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;'
-                            }
-                        ]
+                        cn : [ img ]
+                            
                     }
                 ]
             });
index 7ac3d5a..f06caec 100644 (file)
@@ -6,5 +6,6 @@ Roo.mailer.Block=function(A){Roo.mailer.Block.superclass.constructor.call(this,A
 //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,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;'}]}]});}
+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',width:'100%',getAutoCreate:function(){var tr={tag:'tr',cn:[]};var cfg={tag:'table',border:0,cellpadding:20,cellspacing:0,width:this.width,cn:[]};if(this.src!=''){var A={tag:'img',src:this.src,cls:'roo-m-column-image',style:'max-width: '+(this.width=='100%'?'260':this.width)+'px;'};if(this.width!='100%'){A.width=this.width;}
+cfg.cn.push({tag:'tr',cn:[{tag:'td',align:'center',valight:'top',cls:'roo-m-column-'+this.column+'-content',cn:[A]}]});}
 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();}});