r1326 - trunk/js

[email protected]
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Thu Jun  2 16:37:09 2005
New Revision: 1326

Modified:
   trunk/js/bxeFunctions.js
   trunk/js/table.js
Log:
http://cvs.wyona.org/cgi-bin/bugzilla/show_bug.cgi?id=3417
split down split right problems


Modified: trunk/js/bxeFunctions.js
==============================================================================
--- trunk/js/bxeFunctions.js	(original)
+++ trunk/js/bxeFunctions.js	Thu Jun  2 16:37:09 2005
@@ -875,9 +875,14 @@
 	
 	var newnode = xmlnode.splitText(cssr.startOffset);
 	if (newnode.nodeValue == '') {
-		newnode.appendChild(document.createTextNode(STRING_NBSP));
+		newnode.nodeValue = STRING_NBSP;
 	}
 	
+	if (xmlnode.nodeValue == '') {
+		xmlnode.nodeValue = STRING_NBSP;
+	}
+	
+	
 	//split all up to node	
 	if (node) {
 		var _pos = 0;

Modified: trunk/js/table.js
==============================================================================
--- trunk/js/table.js	(original)
+++ trunk/js/table.js	Thu Jun  2 16:37:09 2005
@@ -45,7 +45,7 @@
 	var prevSibling = this.previousSibling;
 	var pos = 1;
 	while(prevSibling) {
-		if (prevSibling.nodeType == 1 && (prevSibling.localName.toLowerCase() == "td" || cell.localName.toLowerCase() == "th")) {
+		if (prevSibling.nodeType == 1 && (prevSibling.localName == "td" || cell.localName == "th")) {
 			var _attr = prevSibling.getAttribute("colspan");
 			if (_attr > 0) {
 				pos += parseInt( _attr);
@@ -175,19 +175,24 @@
 		first.removeAttribute("rowspan");
 	}
 	
-	
-	var nextSibling = first.nextSibling;
+	if (first.nextSibling) {
+		var nextSibling = first.nextSibling;
+	} 
 	while (nextSibling && nextSibling.nodeType != 1) {
 		nextSibling = nextSibling.nextSibling;
 	}
 	if (nextSibling) {
 		nextSibling.removeAttribute("rowspan");
 	}
-	
-	cell = matrix[rowPos + rowspan - 1][colPos + 1][1];
+	var cell = matrix[rowPos + rowspan - 1][colPos + 1];
+	if (cell) {
+		cell = cell[1];
+	}
 	if (cell) {
 		cell.parentNode.insertBefore(nextSibling,cell);
 	} else {
+		//get next tr from first td cell of next row
+		var nexttr = matrix[rowPos + rowspan - 1][1][1].parentNode;
 		nexttr.appendChild(nextSibling);
 	}
 	return first.parentNode.parentNode;
-- 
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.