1//animate the opening of the branch (span.grower jQueryElement) 2function openBranch(jQueryElement, noAnimation) { 3 jQueryElement.addClass('OPEN').removeClass('CLOSE'); 4 if(noAnimation) 5 jQueryElement.parent().find('ul:first').show(); 6 else 7 jQueryElement.parent().find('ul:first').slideDown(); 8} 9//animate the closing of the branch (span.grower jQueryElement) 10function closeBranch(jQueryElement, noAnimation) { 11 jQueryElement.addClass('CLOSE').removeClass('OPEN'); 12 if(noAnimation) 13 jQueryElement.parent().find('ul:first').hide(); 14 else 15 jQueryElement.parent().find('ul:first').slideUp(); 16} 17 18//animate the closing or opening of the branch (ul jQueryElement) 19function toggleBranch(jQueryElement, noAnimation) { 20 if(jQueryElement.hasClass('OPEN')) 21 closeBranch(jQueryElement, noAnimation); 22 else 23 openBranch(jQueryElement, noAnimation); 24} 25 26//when the page is loaded... 27$(document).ready(function () { 28 //to do not execute this script as much as it's called... 29 if(!$('ul.tree.dhtml').hasClass('dynamized')) 30 { 31 //add growers to each ul.tree elements 32 $('ul.tree.dhtml ul').prev().before("<span class='grower OPEN'> </span>"); 33 34 //dynamically add the '.last' class on each last item of a branch 35 $('ul.tree.dhtml ul li:last-child, ul.tree.dhtml li:last-child').addClass('last'); 36 37 //collapse every expanded branch 38 $('ul.tree.dhtml span.grower.OPEN').addClass('CLOSE').removeClass('OPEN').parent().find('ul:first').hide(); 39 $('ul.tree.dhtml').show(); 40 41 //open the tree for the selected branch 42 $('ul.tree.dhtml .selected').parents().each( function() { 43 if ($(this).is('ul')) 44 toggleBranch($(this).prev().prev(), true); 45 }); 46 toggleBranch( $('ul.tree.dhtml .selected').prev(), true); 47 48 //add a fonction on clicks on growers 49 $('ul.tree.dhtml span.grower').click(function(){ 50 toggleBranch($(this)); 51 }); 52 //mark this 'ul.tree' elements as already 'dynamized' 53 $('ul.tree.dhtml').addClass('dynamized'); 54 55 $('ul.tree.dhtml').removeClass('dhtml'); 56 } 57});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.