Skip to content

Commit

Permalink
bugfix clicking anchors with multiple menus
Browse files Browse the repository at this point in the history
  • Loading branch information
FrDH committed Nov 28, 2014
1 parent c7133dc commit 8269682
Show file tree
Hide file tree
Showing 17 changed files with 52 additions and 45 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jQuery.mmenu",
"main": "src/js/jquery.mmenu.min.js",
"version": "4.7.3",
"version": "4.7.4",
"homepage": "http://mmenu.frebsite.nl/",
"authors": [
"Fred Heusschen <[email protected]>"
Expand Down
2 changes: 1 addition & 1 deletion mmenu.jquery.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mmenu",
"version": "4.7.3",
"version": "4.7.4",
"title": "jQuery mmenu",
"description": "The best jQuery plugin for app look-alike on- and off-canvas menus with sliding submenus for your website and webapp.",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion src/js/addons/addon-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},

// _clickAnchor: prevents default behavior when clicking an anchor
_clickAnchor: function( $a )
_clickAnchor: function( $a, inMenu )
{
// if ( $a.is( '.CLASSNAME' ) )
// {
Expand Down
23 changes: 13 additions & 10 deletions src/js/addons/jquery.mmenu.labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,22 @@

glbl = $[ _PLUGIN_ ].glbl;
},

// _clickAnchor: prevents default behavior when clicking an anchor
_clickAnchor: function( $a )
_clickAnchor: function( $a, inMenu )
{
var $l = $a.parent();
if ( $l.is( '.' + _c.label ) )
if ( inMenu )
{
var $e = $l.nextUntil( '.' + _c.label, '.' + _c.collapsed );

$l.toggleClass( _c.opened );
$e[ $l.hasClass( _c.opened ) ? 'addClass' : 'removeClass' ]( _c.uncollapsed );

return true;
var $l = $a.parent();
if ( $l.is( '.' + _c.label ) )
{
var $e = $l.nextUntil( '.' + _c.label, '.' + _c.collapsed );

$l.toggleClass( _c.opened );
$e[ $l.hasClass( _c.opened ) ? 'addClass' : 'removeClass' ]( _c.uncollapsed );

return true;
}
}
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/addons/jquery.mmenu.labels.min.js

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

4 changes: 2 additions & 2 deletions src/js/addons/jquery.mmenu.offcanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@
},

// _clickAnchor: prevents default behavior when clicking an anchor
_clickAnchor: function( $a )
_clickAnchor: function( $a, inMenu )
{
if ( !this.opts[ _ADDON_ ] )
{
return;
return false;
}

// Open menu
Expand Down
2 changes: 1 addition & 1 deletion src/js/addons/jquery.mmenu.offcanvas.min.js

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

Loading

0 comments on commit 8269682

Please sign in to comment.