r1562 - branches/bxe_2_0/js

[email protected] Sun, 22 Oct 2006 22:04:11 +0200 (CEST)
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Sun Oct 22 22:04:09 2006
New Revision: 1562

Modified:
   branches/bxe_2_0/js/bxeFunctions.js
Log:
somehow fixes #39. cursor stays now near cleaned element


Modified: branches/bxe_2_0/js/bxeFunctions.js
==============================================================================
--- branches/bxe_2_0/js/bxeFunctions.js	(original)
+++ branches/bxe_2_0/js/bxeFunctions.js	Sun Oct 22 22:04:09 2006
@@ -1734,8 +1734,18 @@
 			
 		}
 	}
-	
+	if (textContainer.parentNode == null) {
+		var _prev = sel.anchorNode.parentNode.previousSibling;
+			var sel = window.getSelection();
+		var _pos = 0;
+		if (_prev) {
+			_pos = _prev.nodeValue.length;
+			sel.collapse(_prev,_pos);
+		}
+	}
 	bxe_Transform();
+	
+	
 	/*
 	
 	FIXME: It doesn't clean nested inline styles right now.... This would be the way to do it, 
@@ -2222,7 +2232,7 @@
 
 function bxe_Transform(xpath, position, validateNode) {
 	startTimer = new Date();
-	dump("TRANSORM\n");
+	dump("TRANSFsORM\n");
 	var xml = bxe_config.xmldoc;
 	
 	
@@ -2298,10 +2308,11 @@
 	if (typeof xpath == "string") {
 		var _node = bxe_getHTMLNodeByBxeId(xpath);
 		sel = window.getSelection();
-		
+		console.log(_node);
 		// the selection stuff does not always work
 		if (_node) {
 			try {
+				console.log(position);
 				if (position == "select") {
 					sel.collapse(_node.firstChild,0);
 					sel.extend(_node.firstChild,_node.firstChild.length);
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs