Only use expander indicators to drill down in tree
[gitphp.git] / js / tree.js
blob:a/js/tree.js -> blob:b/js/tree.js
--- a/js/tree.js
+++ b/js/tree.js
@@ -16,7 +16,7 @@
 	a.addClass('jsTree');
 	a.addClass('expander');
 	return a;
-}
+};
 
 function initTree() {
 	var url = window.location.href.match(/^([^\?]+\/)/);
@@ -73,7 +73,7 @@
 			img.attr('src', url + "images/tree-loader.gif");
 			img.attr('alt', GITPHP_RES_LOADING);
 			img.addClass('treeSpinner');
-			img.appendTo(cell);
+			row.find('a.treeLink').after(img);
 
 			$.get($(this).attr('href'), { o: 'js' },
 			function(data) {
@@ -110,13 +110,13 @@
 				row.after(subRows);
 
 				row.find('a.expander').text(expanded);
-				cell.children('img.treeSpinner').remove();
+				row.find('img.treeSpinner').remove();
 			});
 		}
 
 		return false;
 	});
-}
+};
 
 $(document).ready(function() {
 	initTree();

comments