-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathadjustments.js
More file actions
60 lines (49 loc) · 1.75 KB
/
adjustments.js
File metadata and controls
60 lines (49 loc) · 1.75 KB
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
$(function(){
var pageHeight;
function set_columns() {
pageHeight = 0;
$('footer').css('margin-top', '0');
$('.nav-border').css('height', '600');
pageHeight = $(document).height();
// console.log(pageHeight);
$('.nav-border').css('height', pageHeight);
var margin = pageHeight - 511 - 158;
if (pageHeight < 800){
margin = 270;
$('body').css('height', '930');
$('.nav-border').css('height', '930');
}
$('footer').css('margin-top', margin);
$('footer').css('display', 'block');
if($(window).width() > 1171){$('.docs-sidebar').css({'position': 'absolute', 'right': '0'})};
if($(window).width() < 1171){$('.docs-sidebar').css('position', 'static');}
}
//This variable checks if all accordions are closed. Used to ensure styling for Releases & FAQ page.
var allClosed;
//Close all accordions, besides the menu containing the page that you've clicked on.
$('.toctree-l1').each(function(){
if($(this).children('a').attr('state') == 'open') {
$(this).children('ul').show();
set_columns();
allClosed = false;
return false;
} else {
allClosed = true;
}
});
if (allClosed == true) {set_columns();}
//If menu is closed when clicked, expand it
$('.toctree-l1 > a').click(function() {
//Make the titles of open accordions dead links
if ($(this).attr('state') == 'open') {return false;}
//Clicking on a title of a closed accordion
if($(this).attr('state') != 'open' && $(this).siblings().size() > 0) {
$('.toctree-l1 > ul').hide();
$('.toctree-l1 > a').attr('state', '');
$(this).attr('state', 'open');
$(this).next().slideDown(function(){set_columns();});
return false;
}
});
$(window).resize(set_columns);
});