Skip to content
This repository was archived by the owner on May 10, 2021. It is now read-only.

Commit 2973f9b

Browse files
committed
Some more css work
1 parent 97e9f48 commit 2973f9b

File tree

2 files changed

+146
-222
lines changed

2 files changed

+146
-222
lines changed

scripts/script.js

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ HeaderToNav.prototype.buildElements = function() {
4949
});
5050

5151
// wrap 'li' items in 'ul' and 'nav'.
52-
this.addToDom = '<nav id="side"><div id="toggleButton"><span></span></div><ul>' +
52+
this.addToDom = '<nav id="side"><div id="toggleButton"><span class="iconSideNavControl"></span></div><ul>' +
5353
this.addToDom + '</ul></nav>';
5454
return this;
5555
}
@@ -80,23 +80,13 @@ HeaderToNav.prototype.insert = function(element) {
8080
avoided for this reason.
8181
*/
8282
function navToggle() {
83-
// corresponds to '.content, #side' widths, and a small buffer
84-
var minScreenWidth = 780 + 50 + 30;
85-
if ($('nav#side ul').is(':visible')) { // Close side nav.
86-
$('nav#side ul').hide();
87-
$('#toggleButton span').removeClass('iconSideNavControl');
88-
if ($(window).width() < minScreenWidth) {
89-
// Prevent obstruction of content on small screens.
90-
$('.content').css('margin-left', $('nav#side').outerWidth() + "px");
91-
} else {
92-
$('.content').css('margin-left', 'auto');
93-
}
94-
} else { // Show side nav.
95-
$('nav#side ul').show();
96-
$('#toggleButton span').addClass('iconSideNavControl');
97-
if ($(window).width() >= minScreenWidth) {
98-
// Overlay instead of narrowing content on small screens.
99-
$('.content').css('margin-left', $('nav#side').outerWidth() + "px");
100-
}
101-
}
83+
$('nav#side ul').toggle();
84+
$('#toggleButton span').toggleClass('iconSideNavControl');
85+
// if ($('nav#side ul').is(':visible')) { // Close side nav.
86+
// $('nav#side ul').hide();
87+
// $('#toggleButton span').removeClass('iconSideNavControl');
88+
// } else { // Show side nav.
89+
// $('nav#side ul').show();
90+
// $('#toggleButton span').addClass('iconSideNavControl');
91+
// }
10292
}

0 commit comments

Comments
 (0)