forked from magento/devdocs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevdocs.js
46 lines (34 loc) · 889 Bytes
/
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
$(function() {
if ($.cookie('searchResultsState') ==1) {
//show search results page
showSearchBox();
} else {
$.cookie('searchResultsState', '0');
hideSearchBox();
}
$('form').submit(function(event) {
showSearchBox();
});
$('.search-trigger').click(function () {
showSearchBox();
});
$('DIV.searchResultsBoxClose').click(function(){
hideSearchBox();
});
function showSearchBox () {
$('#searchResultsBox').fadeIn(300, function () {
// Callback function that focuses on input
$('input.gsc-input').focus();
});
$('.searchResultsBack').fadeIn(300);
$.cookie('searchResultsState', '1');
}
function hideSearchBox () {
$('#searchResultsBox').fadeOut(300, function () {
// Callback function that focuses out of input
$('input.gsc-input').blur();
});
$('.searchResultsBack').fadeOut(300);
$.cookie('searchResultsState','0');
}
});