Skip to content

Commit fbefd60

Browse files
author
Joseph Lowinske
committed
update responsive behavior of landing page; reimplement sidebar accordion behavior on all pages
1 parent 21917ce commit fbefd60

File tree

5 files changed

+26
-49
lines changed

5 files changed

+26
-49
lines changed

_includes/sidebar.html

+5-35
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,10 @@
77
$maincontent = $('#main-content'),
88
$contentcol = $('.content-col');
99

10-
var navgocoOptionsSidebar = {
10+
var navgocoOptions = {
1111
caretHtml: '',
12-
accordion: false,
13-
openClass: 'active--expand',
14-
save: true,
15-
cookie: {
16-
name: 'navgoco',
17-
expires: false,
18-
path: '/'
19-
},
20-
slide: {
21-
duration: 150,
22-
easing: 'swing'
23-
}
24-
};
25-
26-
var navgocoOptionsVersionSwitcher = {
27-
caretHtml: '',
28-
accordion: false,
29-
openClass: 'active--expand',
12+
accordion: true,
13+
openClass: 'active',
3014
save: false,
3115
cookie: {
3216
name: 'navgoco',
@@ -39,26 +23,12 @@
3923
}
4024
};
4125

42-
{% if page.version.version == 'v2.1' %}
43-
if ($(window).width() >= 992) {
44-
$('#mysidebar .tier-1').addClass('active--expand');
45-
}
46-
47-
$(window).on('resize', function() {
48-
if ($(window).width() > 992) {
49-
$('#mysidebar .tier-1>ul').slideDown(0);
50-
} else {
51-
$('#mysidebar .tier-1>ul').slideUp(0);
52-
}
53-
});
54-
{% endif %}
55-
5626
function closeVersionSwitcher() {
5727
$('#version-switcher .tier-1 ul').slideUp();
5828
$('#version-switcher').removeClass('open');
5929
}
6030

61-
$sidebar.navgoco($.extend(navgocoOptionsSidebar, {
31+
$sidebar.navgoco($.extend(navgocoOptions, {
6232
onToggleAfter: function() {
6333
if ($(this.el).attr('id') == 'mysidebar' &&
6434
$('#version-switcher').hasClass('open')) {
@@ -67,7 +37,7 @@
6737
}
6838
}));
6939

70-
$versionSwitcher.navgoco($.extend(navgocoOptionsVersionSwitcher, {
40+
$versionSwitcher.navgoco($.extend(navgocoOptions, {
7141
onToggleBefore: function() {
7242
$('#version-switcher').toggleClass('open');
7343
}

css/customstyles.css

+14-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/customstyles.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/layouts/_landing-page.scss

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,18 @@
1616

1717
@include at-query($min, $screen-xsm) {
1818
height: 75px;
19-
width: calc(33% - 15.5px);
20-
margin-right: 10px;
21-
margin-left: 10px;
19+
width: calc(33% - 8.5px);
2220
}
2321

24-
@include at-query($min, $screen-sm) { width: calc(33% - 14.5px); }
25-
2622
&.install {
2723
.landing-page__tutorial--tile-icon { content: url(../images/cl-download.svg); }
2824
.landing-page__tutorial--tile-label {
2925
&:after {
3026
content: 'Install';
3127

3228
@include at-query($min, $screen-sm) { content: 'Install CockroachDB'; }
29+
@include at-query($min, $screen-md) { content: 'Install'; }
30+
@include at-query($min, $screen-lg + 130px) { content: 'Install CockroachDB'; }
3331
}
3432
}
3533
}
@@ -41,6 +39,8 @@
4139
content: 'Start cluster';
4240

4341
@include at-query($min, $screen-sm) { content: 'Start a cluster'; }
42+
@include at-query($min, $screen-md) { content: 'Start cluster'; }
43+
@include at-query($min, $screen-lg) { content: 'Start a cluster'; }
4444
}
4545
}
4646
}

css/layouts/_sidebar.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ body.sidenav-open {
277277
}
278278
}
279279

280-
li.active--expand {
280+
li.active {
281281
> a {
282282
.arrow-down {
283283
transform: rotate(-135deg);

0 commit comments

Comments
 (0)