Skip to content

Commit 5ce8fb9

Browse files
author
Joseph Lowinske
committed
remove unnecessary content resizing algorithm
1 parent 31ef732 commit 5ce8fb9

File tree

2 files changed

+5
-35
lines changed

2 files changed

+5
-35
lines changed

_includes/sidebar.html

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
var navgocoOptions = {
1111
caretHtml: '',
1212
accordion: false,
13-
openClass: 'active--expand', // open
14-
save: false, // leave false or nav highlighting doesn't work right
13+
openClass: 'active--expand',
14+
save: false,
1515
cookie: {
1616
name: 'navgoco',
1717
expires: false,
@@ -23,35 +23,7 @@
2323
}
2424
};
2525

26-
// when/if we decide to include this functionality in other versions, we can remove the conditional liquid statement
27-
// and migrate the contained code block to customscripts.js
28-
{% if page.version.version == 'v2.1' %}
29-
if ($(window).width() >= 992) {
30-
$('#mysidebar .tier-1').addClass('active--expand');
31-
}
32-
33-
$(window).on('resize', function() {
34-
if ($(window).width() > 992) {
35-
$('#mysidebar .tier-1>ul').slideDown(0);
36-
adjustMinHeight();
37-
} else {
38-
$('#mysidebar .tier-1>ul').slideUp(0);
39-
}
40-
});
41-
{% endif %}
42-
43-
function adjustMinHeight(duration) {
44-
setTimeout(function() {
45-
var height = $sidebar.outerHeight();
46-
if(height > 475) {
47-
$maincontent.animate({ 'min-height' : 625 + (height - 475) }, 200);
48-
$contentcol.css({ 'min-height' : 625 + (height - 475) });
49-
} else {
50-
$maincontent.animate({ 'min-height' : 625 }, 200);
51-
$contentcol.css({ 'min-height' : 625 });
52-
}
53-
}, 200);
54-
}
26+
$('#mysidebar .tier-1').addClass('active--expand');
5527

5628
function closeVersionSwitcher() {
5729
$('#version-switcher .tier-1 ul').slideUp();
@@ -60,7 +32,6 @@
6032

6133
$sidebar.navgoco($.extend(navgocoOptions, {
6234
onToggleAfter: function() {
63-
adjustMinHeight();
6435
if ($(this.el).attr('id') == 'mysidebar' &&
6536
$('#version-switcher').hasClass('open')) {
6637
closeVersionSwitcher();
@@ -76,7 +47,6 @@
7647

7748
$sidebar.show();
7849
$versionSwitcher.show();
79-
adjustMinHeight();
8050
});
8151
</script>
8252

js/customscripts.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ $(function() {
123123
$colSidebar.css('bottom', '');
124124
$versionSwitcher.css({'bottom': '0'});
125125

126-
var scrolled = $('.col-sidebar').hasClass('col-sidebar--scrolled');
126+
var scrolled = $colSidebar.hasClass('col-sidebar--scrolled');
127127
if ($sidebar.hasClass('nav--collapsed') && scrollTop > 0 && !scrolled) {
128-
$('.col-sidebar').addClass('col-sidebar--scrolled');
128+
$colSidebar.addClass('col-sidebar--scrolled');
129129
$('.collapsed-header__pre').slideUp(250);
130130
sideNavHeight = '40px';
131131
$sidebar.animate({height: sideNavHeight}, {duration: 250});

0 commit comments

Comments
 (0)