Skip to content

Commit

Permalink
Fix typo in menu button class
Browse files Browse the repository at this point in the history
- .navtoogle should be .navtoggle
- Fixes #175
  • Loading branch information
mmistakes committed Aug 19, 2015
1 parent e7489a1 commit d5a0a2e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions _sass/page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ $button-size: 1.5rem;
}
}
// Style the toggle menu link and hide it
.nav .navtoogle {
.nav .navtoggle {
@include font-rem(18);
font-weight: normal;
background-color: $black;
Expand All @@ -180,7 +180,7 @@ $button-size: 1.5rem;
border: none;
background: none;
}
.navtoogle i {
.navtoggle i {
z-index:-1;
}
.icon-menu {
Expand Down
6 changes: 3 additions & 3 deletions assets/js/_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ var changeClass = function (r,className1,className2) {
};
// Creating our button in JS for smaller screens
var menuElements = document.getElementById('site-nav');
menuElements.insertAdjacentHTML('afterBegin','<button type="button" role="button" id="menutoggle" class="navtoogle navicon-lines-button x" aria-hidden="true"><span class="navicon-lines"></span>menu</button>');
menuElements.insertAdjacentHTML('afterBegin','<button type="button" role="button" id="menutoggle" class="navtoggle navicon-lines-button x" aria-hidden="true"><span class="navicon-lines"></span>menu</button>');

// Toggle the class on click to show / hide the menu
document.getElementById('menutoggle').onclick = function() {
changeClass(this, 'navtoogle active', 'navtoogle');
changeClass(this, 'navtoggle active', 'navtoggle');
};
// http://tympanus.net/codrops/2013/05/08/responsive-retina-ready-menu/comment-page-2/#comment-438918
document.onclick = function(e) {
var mobileButton = document.getElementById('menutoggle'),
buttonStyle = mobileButton.currentStyle ? mobileButton.currentStyle.display : getComputedStyle(mobileButton, null).display;

if(buttonStyle === 'block' && e.target !== mobileButton && new RegExp(' ' + 'active' + ' ').test(' ' + mobileButton.className + ' ')) {
changeClass(mobileButton, 'navtoogle active', 'navtoogle');
changeClass(mobileButton, 'navtoggle active', 'navtoggle');
}
};

Expand Down
Loading

0 comments on commit d5a0a2e

Please sign in to comment.