Author: raintang
Date: 2009-09-18 09:33:53 +0200 (Fri, 18 Sep 2009)
New Revision: 38679

Modified:
   
CMSContainer/trunk/CMSContainer/cmsc/richtext/src/webapp/mmbase/edit/wizard/xinha/my-htmlarea.js
Log:
CMSC-1532 Inserting image in rich text editor returns wrong sizes into article 
at IE

Modified: 
CMSContainer/trunk/CMSContainer/cmsc/richtext/src/webapp/mmbase/edit/wizard/xinha/my-htmlarea.js
===================================================================
--- 
CMSContainer/trunk/CMSContainer/cmsc/richtext/src/webapp/mmbase/edit/wizard/xinha/my-htmlarea.js
    2009-09-18 03:06:19 UTC (rev 38678)
+++ 
CMSContainer/trunk/CMSContainer/cmsc/richtext/src/webapp/mmbase/edit/wizard/xinha/my-htmlarea.js
    2009-09-18 07:33:53 UTC (rev 38679)
@@ -396,17 +396,17 @@
                 }
                 var img = image;
                 if (!img) {
-                 // if ( Xinha.is_ie ) {
-                  //  var sel = editor._getSelection();
-                 //   var range = editor._createRange(sel);
-                  //  editor._doc.execCommand("insertimage", false, 
param.f_url);
-                  //  img = range.parentElement();
+                  if ( Xinha.is_ie ) {
+                    var sel = editor._getSelection();
+                    var range = editor._createRange(sel);
+                    editor._doc.execCommand("insertimage", false, param.f_url);
+                    img = range.parentElement();
                     // wonder if this works...
-                 //   if ( img.tagName.toLowerCase() != "img" ) {
-                 //     img = img.previousSibling;
-                 //   }
-                 //  }
-                 //  else {
+                    if ( img.tagName.toLowerCase() != "img" ) {
+                      img = img.previousSibling;
+                    }
+                   }
+                   else {
                     img = document.createElement('img');
                     img.src = param.f_url;
                     editor.insertNodeAtSelection(img);
@@ -414,7 +414,7 @@
                       // if the cursor is at the beginning of the document
                       img = range.startContainer.firstChild;
                     }
-                //  }
+                  }
                 } else {
                   img.src = param.f_url;
                 }

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to