-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathadjustments.js
More file actions
63 lines (50 loc) · 1.67 KB
/
adjustments.js
File metadata and controls
63 lines (50 loc) · 1.67 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
61
62
63
$(document).ready(function() {
// init foundation for offcanvas menu
$(document).foundation();
// custom theme js for sidebar links
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();
allClosed = false;
return false;
} else {
allClosed = true;
}
});
if (allClosed == true) { }
// 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(){});
return false;
}
});
// insert urls into markdown
$(function(){
$('a#AWS').attr('href', documentationBaseURL + '/quickstart/provider/aws/boot/')
$('a#GKE').attr('href', documentationBaseURL + '/quickstart/provider/gke/boot/')
$('a#Vagrant').attr('href', documentationBaseURL + '/quickstart/provider/vagrant/boot/')
});
});
// use headroom.js for sticky topbar
(function() {
var searchBar = document.querySelector(".top-bar");
new Headroom(searchBar, {
offset: 50,
classes: {
"initial": "headroom",
"pinned": "headroom--pinned",
"unpinned": "headroom--unpinned",
"top" : "headroom--top",
"notTop" : "headroom--not-top"
}
}).init();
}());