Skip to content

Commit

Permalink
Close navbar when link clicked
Browse files Browse the repository at this point in the history
  • Loading branch information
chambaz committed Dec 2, 2013
1 parent a6ea9a3 commit 4cde741
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions js/libs/ui/gumby.navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
this.$dropDowns = this.$el.find('li:has(.dropdown)');
var scope = this;

this.$el.find('li:not(:has(.dropdown)) a').on(Gumby.click, function() {
scope.$el.find('ul').removeClass('active');
});

// when navbar items
this.$dropDowns
// are tapped hide/show dropdowns
Expand All @@ -40,6 +44,10 @@
Navbar.prototype.toggleDropdown = function(e) {
e.preventDefault();

if($(e.target).is('i')) {
return;
}

var $this = $(this);

if($this.hasClass('active')) {
Expand Down

0 comments on commit 4cde741

Please sign in to comment.