method: 'POST',
mask : "Loading",
params : {
- importUrl : l.protocol +'//' + l.host + rootURL + '/Pman/Crm/mail_templates/responsive1.html',
+ importUrl : l.protocol +'//' + l.host + rootURL + '/Pman/Crm/mail_templates/responsive1.html'
},
success : function (res) {
'vertical-align',
'cursor',
'z-index',
- 'right',
+ 'right'
],
height : 250,
name : 'bodytext',
combo.setValue('');
}).defer(100);
var editor = _this.form.findField('bodytext').editorcore;
- editor.insertAtCursor(
+
+ var curnode = editor.getSelectedNode();
+ if (curnode && curnode.tagName == 'IMG') {
+ curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',
+ baseURL, record.data.id, record.data.filename
+ );
+ // note -forces an update... hopefully...
+ editor.owner.fireEvent('editorevent', editor, false);
+ } else {
+
+ editor.insertAtCursor(
String.format('<img src="{0}/Images/{1}/{2}#image-{1}">',
baseURL, record.data.id, record.data.filename
)
- );
+ );
+ }
}
},
var height = r.data.height;
if(width > 50){
+ height = Math.round(height * 50 / width);
width = 50;
- height = Math.round(height *width / 50);
}
return '<img src="' + baseURL + '/Images/' + r.data.id + '/' + r.data.filename + '" width="' + width + '" height="' + height + '" />';