forked from googleapis/google-cloud-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
executable file
·59 lines (54 loc) · 1.55 KB
/
main.js
File metadata and controls
executable file
·59 lines (54 loc) · 1.55 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
$('.nav-current').click(function(){
$('.main-nav').toggleClass('open');
});
$('.faq-btn').click(function(){
$(this).toggleClass('open');
});
$('.headerlink').parent().each(function() {
$(this).hover(
function() { $(this).children('.headerlink').show(); },
function() { $(this).children('.headerlink').hide(); }
);
});
var apiQsSection;
// don't even ask me why
if ($('#cloud-datastore-in-10-seconds').length)
apiQsSection = $('#cloud-datastore-in-10-seconds');
else if ($('#cloud-storage-in-10-seconds').length)
apiQsSection = $('#cloud-storage-in-10-seconds');
else if ($('#cloud-pubsub-in-10-seconds').length)
apiQsSection = $('#cloud-pubsub-in-10-seconds');
else if ($('#cloud-bigquery-in-10-seconds').length)
apiQsSection = $('#cloud-bigquery-in-10-seconds');
if(apiQsSection) {
var apiQsSubSections = apiQsSection.children('div');
var showToggle = $('<span></span>')
.text('▹')
.addClass('toggle');
var hideToggle = $('<span></span>')
.text('▿')
.addClass('toggle')
.hide();
showToggle.click(function() {
showToggle.hide();
hideToggle.show();
apiQsSubSections.each(function() {
$(this).show();
})
});
hideToggle.click(function() {
hideToggle.hide();
showToggle.show();
apiQsSubSections.each(function() {
$(this).hide();
})
});
var toggler = $('<div></div>')
.addClass('toggler')
.append(showToggle)
.append(hideToggle);
apiQsSubSections.each(function() {
$(this).hide();
});
$(apiQsSection).children('h2').first().prepend(toggler);
}