r1689 - branches/bxe_2_0/js

[email protected] Mon, 23 Jul 2007 15:06:24 +0200 (CEST)
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Mon Jul 23 15:06:24 2007
New Revision: 1689

Log:
fix for BXEB-8
 Spezielle Tabellenfunktionen arbeiten nicht Grammatik-sensitiv



Modified:
   branches/bxe_2_0/js/table.js

Modified: branches/bxe_2_0/js/table.js
==============================================================================
--- branches/bxe_2_0/js/table.js	(original)
+++ branches/bxe_2_0/js/table.js	Mon Jul 23 15:06:24 2007
@@ -118,7 +118,6 @@
 	var matrix = positions['matrix'];
 	var rowPos = positions['row'];
 	var colPos = positions['col'];
-	console.log(colPos);
 	if (colPos == 1) {
 	
 		alert(bxe_i18n.getText("There's no left cell to be moved"));
@@ -617,7 +616,25 @@
 	
 	var positions = bxe_table_getRowAndColPosition(cell);
 	var matrix = positions['matrix'];
-	var rowPos = positions['row'];
+	
+    
+    // very primitive check for BXEB-8
+    if (matrix[0][0][0] == 1) {
+       alert("Last row, deletion not possible");
+       return matrix;
+    }
+    
+    
+      
+    if (matrix[0][0][0] == 2 && matrix[1][1][1].parentNode.localName != matrix[2][1][1].parentNode.localName) {
+       alert("Last row, deletion not possible");
+       return matrix;
+    }
+    
+    
+    
+    
+    var rowPos = positions['row'];
 	var colPos = positions['col'];
 	//rowPos now contains the row and we can now search for the cell within the matrix
 	//matrix works 1...n
@@ -628,9 +645,11 @@
 	var ny = 0;
 	var rowspan = 1;
 	var colspan = 1;
-	for(var y = 1; y <= matrix[0][0][0]; y++) {
+    
+    
+    for(var y = 1; y <= matrix[0][0][0]; y++) {
 		ny++;
-		nx = 0;
+      	nx = 0;
 		for(var x = 1; x <= matrix[0][0][1]; x++) {
 			nx++;
 			rowspan = 0;
@@ -758,6 +777,16 @@
 {
 	var positions = bxe_table_getRowAndColPosition(cell);
 	var matrix = positions['matrix'];
+    
+     // very primitive check for BXEB-8
+    if (matrix[0][0][1] == 1) {
+       alert("Last col, deletion not possible");
+       return matrix;
+    }
+    
+    
+      
+    
 	var rowPos = positions['row'];
 	var colPos = positions['col'];
 	//first of all we create a new empty matrix with one more col
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs