blob: 8711120ca9ba93aa221d2c30f1cbced4fae37a9f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
// Init sidebar
$(function() {
var activeItem,
helpList = $('#js-help-sidebar .js-topic'),
firstOccurance = true
$('#js-help-sidebar .js-guides').each(function(){
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(){
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')
}
})
});
|