Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
Fix typo in menu button class
Browse files Browse the repository at this point in the history
- .navtoogle should be .navtoggle
- Fixes mmistakes#175
  • Loading branch information
makaroniame committed Aug 19, 2015
1 parent 230d41c commit 950e05f
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 950e05f

Please sign in to comment.