Skip to content

Commit

Permalink
cleans up duplicate variables in dropdown menu
Browse files Browse the repository at this point in the history
  • Loading branch information
zurbchris committed Nov 21, 2015
1 parent ed0a147 commit 10707fe
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions js/foundation.dropdownMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
e.preventDefault();
e.stopPropagation();

if($elem.data('isClick')){
if(hasClicked){
_this._hide($elem);
}else{
_this._hideOthers($elem);
Expand All @@ -203,12 +203,13 @@

if(!this.options.disableHover){
//add ability for all menu items to close an open menu on the same level//
this.$menuItems.on('mouseenter.zf.dropdownmenu', function(e){
var $el = $(this);
if(!$el.hasClass('is-active')){
_this._hideOthers($el);
}
});
this.$menuItems.off('mouseenter.zf.dropdownmenu')
.on('mouseenter.zf.dropdownmenu', function(e){
var $el = $(this);
if(!$el.hasClass('is-active')){
_this._hideOthers($el);
}
});
//elements with submenus
$elem.on('mouseenter.zf.dropdownmenu', function(e){
clearTimeout($elem.closeTimer);
Expand Down

0 comments on commit 10707fe

Please sign in to comment.