DataObjects/Core_enum.php
[Pman.Core] / Pman.Dialog.CoreEmail.js
index 29dbf42..1ca108a 100644 (file)
@@ -743,12 +743,23 @@ Pman.Dialog.CoreEmail = {
                                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
                                    )
-                            );
+                               );
                        
+                           }
                            
                         }
                      },
@@ -1221,11 +1232,8 @@ Pman.Dialog.CoreEmail = {
              var height = r.data.height;
              
              if(width > 50){
-                 width = 50;
-                 Roo.log(height);
-                 Roo.log(50 / width);
-                 Roo.log(height * 50 / width);
                  height = Math.round(height * 50 / width);
+                 width = 50;
              }
              
             return '<img src="' + baseURL + '/Images/' + r.data.id + '/' + r.data.filename + '" width="' + width + '" height="' + height + '" />';