From 836ff8f64638d8bdcdb96e7baa650e998dd663c4 Mon Sep 17 00:00:00 2001 From: Cameron McEfee Date: Fri, 13 May 2011 14:36:31 -0700 Subject: Update styles --- global/js/documentation.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 global/js/documentation.js (limited to 'global/js') diff --git a/global/js/documentation.js b/global/js/documentation.js new file mode 100644 index 0000000..0625a91 --- /dev/null +++ b/global/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 -- cgit v1.3.1