* @param {Object} config The config object
*/
-_calls = 0;
+
Roo.mailer.Body = function(config){
Roo.mailer.Body.superclass.constructor.call(this, config);
marginheight : 0,
offset : 0
});
- _calls++;
- if (_calls > 1) {
+ Roo.mailer.Body._calls++;
+ if (Roo.mailer.Body._calls > 1) {
+ return;
throw "test";
}
};
+Roo.mailer.Body._calls = 0;
+
Roo.extend(Roo.mailer.Body, Roo.bootstrap.Component, {
var tr = {
tag : 'tr',
cls : 'roo-m-block-tr'
- }
+ };
if (this.blocktype != 'row') {
- tr.cn = [
+ tr.cn = [
{
tag : 'td',
align : 'center',
cls : 'roo-m-' + this.blocktype + '-content',
html : this.html
}
- ]
+ ];
}
var cfg = {
align : 'center',
valign : 'top',
style : 'padding-top : 20px;',
- cls : 'roo-m-row'
+ cls : 'roo-m-column'
}
);
* @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
html : '',
src : '',
column : 'left',
+ width : '100%',
getAutoCreate : function(){
var tr = {
tag : 'tr',
cn : [ ]
- }
+ };
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 : [
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 ]
+
}
]
});