Changes between Initial Version and Version 5 of Ticket #455

Show
Ignore:
Timestamp:
09/06/05 17:32:24 (8 years ago)
Author:
mokhet
Comment:

using this patch seems to fix the problem for me so far.

Index: image-manager.js
===================================================================
--- image-manager.js	(revision 307)
+++ image-manager.js	(working copy)
@@ -165,19 +165,21 @@
 		}
 		var img = image;
 		if (!img) {
-			var sel = editor._getSelection();
-			var range = editor._createRange(sel);			
-			editor._doc.execCommand("insertimage", false, param.f_url);
 			if (HTMLArea.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 {
-				img = range.startContainer.previousSibling;
+        img = document.createElement('img');
+        img.src = param.f_url;
+        editor.insertNodeAtSelection(img);
 			}
-		} else {			
+		} else {
 			img.src = param.f_url;
 		}
 		
@@ -209,4 +211,3 @@
 	}, outparam);
 };
 
-

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #455

    • Property summary changed from Javascript Error un inserting new Images to Javascript Error on inserting new Images
  • Ticket #455 – description

    initial v5  
    77}}} 
    88 
     9 
    910When inserting an Image (having this error), giving properties to that image (using the image-properties-dialog) and inserting the same image again sometimes this error disappears. 
    1011