at 15.09-beta 936 B view raw
1$(document).ready(function() { 2 3 /* When a toggle is clicked, show or hide the subtree. */ 4 $(".logTreeToggle").click(function() { 5 if ($(this).siblings("ul:hidden").length != 0) { 6 $(this).siblings("ul").show(); 7 $(this).text("-"); 8 } else { 9 $(this).siblings("ul").hide(); 10 $(this).text("+"); 11 } 12 }); 13 14 /* Implementation of the expand all link. */ 15 $(".logTreeExpandAll").click(function() { 16 $(".logTreeToggle", $(this).parent().siblings(".toplevel")).map(function() { 17 $(this).siblings("ul").show(); 18 $(this).text("-"); 19 }); 20 }); 21 22 /* Implementation of the collapse all link. */ 23 $(".logTreeCollapseAll").click(function() { 24 $(".logTreeToggle", $(this).parent().siblings(".toplevel")).map(function() { 25 $(this).siblings("ul").hide(); 26 $(this).text("+"); 27 }); 28 }); 29 30});