[Piwik-svn] r140 - trunk/plugins/Home/templates

svnmaster at piwik.org svnmaster at piwik.org
Thu Jan 10 21:52:43 CET 2008


Author: matt
Date: 2008-01-10 21:52:42 +0100 (Thu, 10 Jan 2008)
New Revision: 140

Modified:
   trunk/plugins/Home/templates/datatable.js
Log:
Fixed bug when collapsing rows in the actions tables, after including all population!
This js really needs to be put in nice classes!!

Modified: trunk/plugins/Home/templates/datatable.js
===================================================================
--- trunk/plugins/Home/templates/datatable.js	2008-01-10 18:20:16 UTC (rev 139)
+++ trunk/plugins/Home/templates/datatable.js	2008-01-10 20:52:42 UTC (rev 140)
@@ -524,9 +524,11 @@
 {
 	$('img',currentThis).attr('src', 'themes/default/images/plus.png');
 }
-var parentId;
-var parentAttributeParent;
 
+
+var parentId = '';
+var parentAttributeParent = '';
+
 //called when the full table actions is loaded
 function actionsDataTableLoaded( response )
 {
@@ -534,6 +536,10 @@
 	var idToReplace = $(content).attr('id');
 
 	$('#'+idToReplace).html(content);
+		
+	// reset these values when clicking low population include for example
+	parentId = '';
+	parentAttributeParent = '';
 	
 	$('#'+idToReplace).each( bindActionDataTableEvent );
 }
@@ -697,6 +703,7 @@
 }
 function bindActionDataTableEvent()
 {
+	
 	ActionsLoading = new Array;
 	subTableId = $(this).attr('id');
 	
@@ -757,7 +764,14 @@
 				var level = getNextLevelFromClass( style );
 				$(this).addClass('level'+ level);
 			}	
-			$(this).attr('parent', function(){ return parentAttributeParent + ' ' + parentId;} );
+			
+			// we add an attribute parent that contains the ID of all the parent categories
+			// this ID is used when collapsing a parent row, it searches for all children rows
+			// which 'parent' attribute's value contains the collapsed row ID 
+			$(this).attr('parent', function(){ 
+				return parentAttributeParent + ' ' + parentId;
+				}
+			);
 		
 			// Add some styles on the cells even/odd
 			// label (first column of a data row) or not



More information about the Piwik-svn mailing list