r1324 - trunk/js

[email protected]
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Thu Jun  2 15:58:26 2005
New Revision: 1324

Modified:
   trunk/js/table.js
Log:
fix http://cvs.wyona.org/cgi-bin/bugzilla/show_bug.cgi?id=3443
Append row - nur ein <td> bzw <th> element wird eingefugt


Modified: trunk/js/table.js
==============================================================================
--- trunk/js/table.js	(original)
+++ trunk/js/table.js	Thu Jun  2 15:58:26 2005
@@ -45,7 +45,7 @@
 	var prevSibling = this.previousSibling;
 	var pos = 1;
 	while(prevSibling) {
-		if (prevSibling.nodeType == 1 && (prevSibling.localName== "td" || cell.localName.toLowerCase() == "th")) {
+		if (prevSibling.nodeType == 1 && (prevSibling.localName.toLowerCase() == "td" || cell.localName.toLowerCase() == "th")) {
 			var _attr = prevSibling.getAttribute("colspan");
 			if (_attr > 0) {
 				pos += parseInt( _attr);
@@ -199,7 +199,7 @@
 	var nextpos = 1;
 	
 	while (cell) {
-		if (cell.nodeType == 1 && cell.localName == "td") {
+		if (cell.nodeType == 1 && (cell.localName == "td" || cell.localName == "th")) {
 			if (nextpos >= pos) {
 				return cell;
 			}
@@ -380,7 +380,7 @@
 	BX_popup.style.top=BX_popup.offsetTop - 1 + "px";
 	
 }
-
+/*
 function bxe_table_find_current_cell()
 {
 	
@@ -397,7 +397,7 @@
 	
 	return cell;
 	
-}
+}*/
 
 function bxe_table_insert_row(cell)
 {
@@ -973,7 +973,7 @@
 		//loop all real existing table cells
 		for(var c = 0; c < row.childNodes.length; c++) {
 			cell = row.childNodes[c];
-			if(cell.nodeName.toLowerCase() != "td")  continue; //caution: may be there are text nodes (CRLF or whitespace)
+			if(cell.nodeName.toLowerCase() != "td" && cell.nodeName.toLowerCase() != "th")  continue; //caution: may be there are text nodes (CRLF or whitespace)
 			tc++;
 			//find the homogenious matrix pos
 			//alert("tr="+tr+" tc="+tc);
-- 
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.