Skip to content

Commit

Permalink
Fixes #31
Browse files Browse the repository at this point in the history
  • Loading branch information
Vergil Penkov committed Mar 15, 2016
1 parent 896997a commit fda7fc7
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
6 changes: 3 additions & 3 deletions app/css/okayNav-base.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ body.okayNav-loaded {
position: relative;
z-index: 1;
}
.okayNav a:only-of-type {
top: 0;
}
.okayNav__nav--visible {
overflow: hidden;
white-space: nowrap;
Expand All @@ -56,6 +53,9 @@ body.okayNav-loaded {
padding: 15px 15px;
transition: color 200ms cubic-bezier(0.55, 0, 0.1, 1);
}
.okayNav__nav--visible:empty ~ .okayNav__menu-toggle {
top: 0;
}
/* Link styling for the off-screen part of the nav */
.okayNav__nav--invisible {
position: fixed;
Expand Down
7 changes: 7 additions & 0 deletions app/js/jquery.okayNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@

// Events are up once everything is set
self.initEvents();

// Trim white spaces between visible nav elements
$nav_visible.contents().filter(function() {
return this.nodeType = Node.TEXT_NODE && /\S/.test(this.nodeValue) === false;
}).remove();

if (_options.swipe_enabled == true) self.initSwipeEvents();
},

Expand Down Expand Up @@ -371,6 +377,7 @@
self._expandNavItem();
}


// Hide the kebab icon if no items are hidden
self.getHiddenItemCount() == 0 ?
$nav_toggle_icon.addClass('okay-invisible') :
Expand Down
9 changes: 4 additions & 5 deletions app/less/okayNav-base.less
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ body.okayNav-loaded {overflow-x: hidden}
a {
position: relative;
z-index: 1;

&:only-of-type {
// Bring the kebab icon back to the top if it's alone
top: 0;
}
}
}

Expand All @@ -68,6 +63,10 @@ body.okayNav-loaded {overflow-x: hidden}

transition: color @oknav-transition-speed @oknav-transition-curve;
}

&:empty {
& ~ .okayNav__menu-toggle {top: 0}
}
}

/* Link styling for the off-screen part of the nav */
Expand Down
2 changes: 1 addition & 1 deletion dist/css/okayNav.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/js/jquery.okayNav-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fda7fc7

Please sign in to comment.