diff options
| author | Cameron McEfee <cameron@github.com> | 2011-05-16 15:59:52 -0700 |
|---|---|---|
| committer | Cameron McEfee <cameron@github.com> | 2011-05-16 16:55:32 -0700 |
| commit | 4a73a1e5bc6ae610f356cbaafec5c32c4a9bb95a (patch) | |
| tree | a3e0e63a1823567e8f5095bb9cf2dc8ba3ee8268 /shared/js/documentation.js | |
| parent | 6a43807ebdc863d360330845eb4cc3b5d0efb10f (diff) | |
add shared
Diffstat (limited to 'shared/js/documentation.js')
| -rw-r--r-- | shared/js/documentation.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/shared/js/documentation.js b/shared/js/documentation.js new file mode 100644 index 0000000..0625a91 --- /dev/null +++ b/shared/js/documentation.js @@ -0,0 +1,38 @@ +// Init sidebar +$(function() { + var activeItem, + helpList = $('#js-help-sidebar .js-topic') + + $('#js-help-sidebar .js-guides').each(function(){ + //if($(this).find('.disable').length == 0){ + $(this).children().hide() + //} + }) + + $('#js-help-sidebar .js-topic h3 a').click(function(){ + var clickedTopic = $(this).parents('.js-topic'), + topicGuides = clickedTopic.find('.js-guides li') + + if(activeItem != clickedTopic.index()){ + if(helpList.eq(activeItem)){ + helpList.eq(activeItem).find('.js-guides li').toggle(100) + } + activeItem = clickedTopic.index() + topicGuides.toggle(100) + } else { + activeItem = undefined + topicGuides.toggle(100) + } + + return false + }) + + $('.help-search .search-box').focus(function(){ + $(this).css('background-position','0px -25px') + }) + $('.help-search .search-box').focusout(function(){ + if($(this).val() == ''){ + $(this).css('background-position','0px 0px') + } + }) +});
\ No newline at end of file |
