forked from magento/devdocs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevdocs.js
79 lines (59 loc) · 1.74 KB
/
devdocs.js
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
$(function() {
if ($.cookie('searchResultsState') ==1) {
//show search results page
showSearchBox();
} else {
$.cookie('searchResultsState', '0');
hideSearchBox();
}
$('#searchbox').submit(function(event) {
showSearchBox();
});
$('#gsc-search-box').submit(function(){
$('input').blur();
});
$('.search-trigger').click(function () {
showSearchBox();
});
$('DIV.searchResultsBoxClose').click(function(){
hideSearchBox();
});
function showSearchBox () {
$('#searchResultsBox').fadeIn(300, function () {
// Callback function that focuses on input
$('#searchResultsBox input.gsc-input').first().focus();
});
$('.searchResultsBack').fadeIn(300);
$.cookie('searchResultsState', '1');
$('body').addClass('search-active');
}
function hideSearchBox () {
$('#searchResultsBox').fadeOut(300, function () {
// Callback function that focuses out of input
$('#searchResultsBox input.gsc-input').first().blur();
});
$('.searchResultsBack').fadeOut(300);
$.cookie('searchResultsState','0');
$('body').removeClass('search-active');
}
// ** Menu **
var menustate ="";
if ( $('LI.level3Child').is("LI.active")) {
menustate = $('LI.active').attr('data-menunode');
$('#' + menustate).show(); //show parent
$('#' + menustate).removeClass('caretRight').addClass('caretDown') //submenu open indication
$('.' + menustate).show(); //show submenu
}
var thirdTier = "";
$('.level3Parent').click(function(){
thirdTier = $(this).attr('id');
if($('.' + thirdTier).is(":visible")) {
$(this).removeClass('caretDown').addClass('caretRight')
$('.' + thirdTier).slideUp(200);
} else {
$(this).removeClass('caretRight').addClass('caretDown')
$('.' + thirdTier).slideDown(200);
}
return false;
});
}); //end devdocs