From 19bac5de92117513f86c7b646a16a139f7e80872 Mon Sep 17 00:00:00 2001 From: Cameron McEfee Date: Mon, 16 May 2011 16:55:19 -0700 Subject: expand active item/category There isn't really a good way to deal with situations where there is more than one category for a post. For now, the script just expands/highlights the first occurrence. This will probably work most of the time, since the only multiple instance posts seem to be OS related. Showing the non-OS category is probably better. Ideally, we should come up with a more concise method of organization where there are no duplicates. --- shared/js/documentation.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'shared/js') diff --git a/shared/js/documentation.js b/shared/js/documentation.js index 0625a91..8711120 100644 --- a/shared/js/documentation.js +++ b/shared/js/documentation.js @@ -1,12 +1,15 @@ // Init sidebar $(function() { var activeItem, - helpList = $('#js-help-sidebar .js-topic') - + helpList = $('#js-help-sidebar .js-topic'), + firstOccurance = true $('#js-help-sidebar .js-guides').each(function(){ - //if($(this).find('.disable').length == 0){ + if($(this).find('.disable').length == 0 || firstOccurance == false){ $(this).children().hide() - //} + } else { + activeItem = $(this).index() + firstOccurance = false + } }) $('#js-help-sidebar .js-topic h3 a').click(function(){ -- cgit v1.3.1