r1376 - trunk/js

[email protected]
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Sat Sep  3 13:54:29 2005
New Revision: 1376

Modified:
   trunk/js/bxeFunctions.js
Log:
fix reverse insertion, when paragraph is only one or 2 chars
http://cvs.wyona.org/cgi-bin/bugzilla/show_bug.cgi?id=3810

Modified: trunk/js/bxeFunctions.js
==============================================================================
--- trunk/js/bxeFunctions.js	(original)
+++ trunk/js/bxeFunctions.js	Sat Sep  3 13:54:29 2005
@@ -2007,10 +2007,19 @@
 				oldStyleInsertion = true;
 			}
 		}
-		
-		while (_currentNode) {
+		if (sel.anchorNode.nodeType == 3) {
+			// if nodeValue == " ", shit happens.
 			
+			var regexp = new RegExp('^[ '+STRING_NBSP+']+$');
+			sel.anchorNode.parentNode.normalize();
+			if (regexp.test(sel.anchorNode.nodeValue)) {
+				sel.anchorNode.nodeValue = "";
+			}
+		}
+		sel.anchorNode.normalize();
+		while (_currentNode) {
 			sel.insertNodeRaw(_node,oldStyleInsertion);
+		
 			_node.updateXMLNode();
 			
 			_currentNode = _currentNode.previousSibling;
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.