r1704 - in branches/bxe_2_0: js mozile

[email protected] Sun, 12 Aug 2007 15:45:01 +0200 (CEST)
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Sun Aug 12 15:45:01 2007
New Revision: 1704

Log:
part fix for BXEB-28
Neue Elemente und Ersetzen


Modified:
   branches/bxe_2_0/js/widget.js
   branches/bxe_2_0/mozile/mozCE.js

Modified: branches/bxe_2_0/js/widget.js
==============================================================================
--- branches/bxe_2_0/js/widget.js	(original)
+++ branches/bxe_2_0/js/widget.js	Sun Aug 12 15:45:01 2007
@@ -1185,7 +1185,16 @@
 		}
 	}
 	var sel = window.getSelection();
-	sel.selectEditableRange(Widget.cssr);
+	try {
+		sel.collapse(Widget.selAnchorNode,Widget.selAnchorOffset);
+		sel.extend(Widget.selFocusNode,Widget.selFocusOffset);
+	} catch (e) {
+		 sel.selectEditableRange(Widget.cssr);
+	}
+		
+	
+	
+	//sel.selectEditableRange(Widget.cssr);
 	if (Widget.callback) {
 		Widget.callback(returnValues);
 	}
@@ -1229,10 +1238,22 @@
 		}
 		this.hasTable.parentNode.appendChild(subm);
 		this.cssr = window.getSelection().getEditableRange();
+		var sel = window.getSelection();
+		this.selAnchorNode = sel.anchorNode;
+		this.selFocusNode = sel.focusNode;
+		this.selAnchorOffset = sel.anchorOffset;
+		this.selFocusOffset = sel.focusOffset;
+		
+	
 		subm.focus();
 	} else {
 		
 		this.cssr = window.getSelection().getEditableRange();
+		this.selAnchorNode = sel.anchorNode;
+		this.selFocusNode = sel.focusNode;
+		this.selAnchorOffset = sel.anchorOffset;
+		this.selFocusOffset = sel.focusOffset;
+		
 	}
 	
 	if (!position) { position = "absolute";};

Modified: branches/bxe_2_0/mozile/mozCE.js
==============================================================================
--- branches/bxe_2_0/mozile/mozCE.js	(original)
+++ branches/bxe_2_0/mozile/mozCE.js	Sun Aug 12 15:45:01 2007
@@ -661,8 +661,10 @@
 	// if there's a selection then delete it
 	if(!cssr.collapsed)
 	{
-		bxe_deleteEventKey(window.getSelection(), false);
+		bxe_deleteEventKey(window.getSelection(), false,false,true);
+		
 	}
+	
 	try {
 		if (this.anchorNode.parentNode.getAttribute("__bxe_defaultcontent") == "true") {
 			var _parx = bxe_getXMLNodeByHTMLNode(this.anchorNode.parentNode);
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs