Skip to content

Commit fdf1e30

Browse files
author
FrDH
committed
fixed no results in deeper nested submenus
- fixed no results in deeper nested submenus - expanded playground example with iconbar extension - small alterations
1 parent aa3889d commit fdf1e30

16 files changed

+151
-101
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "jQuery.mmenu",
33
"main": "src/js/jquery.mmenu.min.js",
4-
"version": "4.3.5",
4+
"version": "4.3.6",
55
"homepage": "http://mmenu.frebsite.nl/",
66
"authors": [
77
"Fred Heusschen <info@frebsite.nl>"

demo/css/demo.css

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ html
88
height: 100%;
99
}
1010

11-
body {
11+
body
12+
{
1213
background-color: #fff;
1314
font-family: Arial, Helvetica, Verdana;
1415
font-size: 14px;
@@ -133,29 +134,38 @@ nav:not(.mm-menu)
133134
top: 0;
134135
left: 10px;
135136
}
136-
.header a.contacts
137-
{
138-
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAVNJREFUeNq01jFLAzEYxvH2UBCxiIiDUhzcdXCyIk5ufgUXLR37JdxcXBxcuwmOOtml0EKpo04iWIpIQREVEVFLjf9AhoC9e3O5uxd+lMLdPU1yedO8UiqXdQWO122ghi4+8IwGqiiId+uRCHbxqsLrFHNRz5ACSnhTch1EPScQpnIH0w7TWcGiz5rouS45rtkMVnxCJrAQ4yUq+oT8YhAjZOAT8oWHGCE9nxC9H64cA15w4xOiW0HbfErVNhvUa8c3cecQcoZv3xA9z+fCNbe4SNq7jvEUMaUnuE/au7SjkHbSR1G637ULh73Kn+gn7cIBttELGckQh9Jo8iMOrSksYx2b2MKk8FuvUUcHl/9GbiWuooYu3pVf/eARLZQxbp8na2YR0659e+HLmM/geN+z98lSRv8hZu2QQkYh+kzKjZkvHdPahymH6DNp5Cucev0JMAAkKj0NEoYBJwAAAABJRU5ErkJggg==);
139-
}
140-
.header a.right
141-
{
142-
left: auto;
143-
right: 10px;
144-
}
145137
.content
146138
{
147139
padding: 150px 50px 50px 50px;
148140
}
149-
.header.mm-fixed-top + .content
141+
142+
.fa
143+
{
144+
font-size: 17px;
145+
margin: 0 20px 0 4px;
146+
}
147+
body.no-icons .fa
150148
{
151-
background-position: 25px 55px;
149+
display: none;
152150
}
153151

154152

155153
html.mm-opened.mm-zoom-menu body
156154
{
157155
background: #333;
158156
}
157+
html.mm-opened.mm-zoom-menu.mm-light body
158+
{
159+
background: #f3f3f3;
160+
}
161+
html.mm-opened.mm-zoom-menu.mm-black body
162+
{
163+
background: #000;
164+
}
165+
html.mm-opened.mm-zoom-menu.mm-white body
166+
{
167+
background: #fff;
168+
}
159169
html.mm-opened.mm-zoom-menu .mm-page
160170
{
161171
background-color: #fff;

demo/playground.html

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77

88
<title>jQuery.mmenu playground demo</title>
99

10+
<link type="text/css" rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" />
1011
<link type="text/css" rel="stylesheet" href="css/demo.css" />
1112
<link type="text/css" rel="stylesheet" href="../src/css/jquery.mmenu.all.css" />
13+
<link type="text/css" rel="stylesheet" data-href="../src/css/extensions/jquery.mmenu.iconbar.css" />
1214

1315
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
1416
<script type="text/javascript" src="../src/js/jquery.mmenu.min.all.js"></script>
@@ -19,19 +21,33 @@
1921
}
2022
else
2123
{
22-
var $orgMenu, $menu, $html;
24+
var $orgMenu, $menu, $html, $body, $link;
2325

2426
$(function() {
2527
$html = $('html');
28+
$body = $('body');
29+
$link = $('link[data-href*=".iconbar.css"]');
30+
2631
$orgMenu = $('nav#menu').detach();
27-
updateMenu({});
2832
});
2933

30-
function updateMenu( opts )
34+
function updateMenu( opts, extr )
3135
{
36+
3237
var opened = false;
3338
var createMenu = function()
3439
{
40+
if ( extr.iconbar )
41+
{
42+
$link.attr( 'href', $link.data( 'href' ) );
43+
$body.removeClass( 'no-icons' );
44+
}
45+
else
46+
{
47+
$link.attr( 'href', '' );
48+
$body.addClass( 'no-icons' );
49+
}
50+
3551
if ( $menu )
3652
{
3753
$menu.remove();
@@ -65,7 +81,7 @@
6581
}
6682
</script>
6783
</head>
68-
<body>
84+
<body class="no-icons">
6985
<div id="page">
7086
<div class="header">
7187
<a href="#menu"></a>
@@ -77,8 +93,12 @@
7793
</div>
7894
<nav id="menu">
7995
<ul>
80-
<li><a href="#">Home</a></li>
81-
<li><a href="#about">About us</a>
96+
<li><a href="#">
97+
<i class="fa fa-home"></i>
98+
Home</a></li>
99+
<li><a href="#about">
100+
<i class="fa fa-user"></i>
101+
About us</a>
82102
<ul>
83103
<li><a href="#about/history">History</a></li>
84104
<li><a href="#about/team">The team</a>
@@ -91,7 +111,9 @@
91111
<li><a href="#about/address">Our address</a></li>
92112
</ul>
93113
</li>
94-
<li><a href="#contact">Contact</a></li>
114+
<li><a href="#contact">
115+
<i class="fa fa-envelope"></i>
116+
Contact</a></li>
95117
</ul>
96118
</nav>
97119
</div>

mmenu.jquery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mmenu",
3-
"version": "4.3.5",
3+
"version": "4.3.6",
44
"title": "jQuery mmenu",
55
"description": "The best jQuery plugin for app look-alike on- and off-canvas menus with sliding submenus for your website and webapp.",
66
"keywords": [

playground.html

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929

3030
$ext_effects = $('#ext_effects'),
3131
$effects = $('input[name="effect"]'),
32+
33+
$iconbar = $('input[name="iconbar"]'),
3234

3335
$ext_position = $('#ext_position'),
3436
$position = $('input[name="position"]'),
@@ -81,6 +83,11 @@
8183
}
8284
);
8385
}
86+
// Iconbar extension
87+
if ( $iconbar.is( ':checked' ) )
88+
{
89+
extr.iconbar = true;
90+
}
8491

8592
// Positioning extension
8693
if ( $ext_position.hasClass( 'mm-opened' ) )
@@ -134,13 +141,13 @@
134141
);
135142
}
136143

137-
// counters add-on
144+
// Counters add-on
138145
if ( $counters.is( ':checked' ) )
139146
{
140147
opts.counters = true;
141148
}
142149

143-
// header add-on
150+
// Header add-on
144151
if ( $add_header.hasClass( 'mm-opened' ) )
145152
{
146153
opts.header = true;
@@ -160,7 +167,7 @@
160167
}
161168
}
162169

163-
// searchfield add-on
170+
// Searchfield add-on
164171
if ( $add_searchfield.hasClass( 'mm-opened' ) )
165172
{
166173
opts.searchfield = true;
@@ -185,7 +192,7 @@
185192

186193
if ( add_opts )
187194
{
188-
opts.searchfield = add_opts;
195+
opts.searchfield = add_opts;
189196
opts.searchfield.add = true;
190197
opts.searchfield.search = true;
191198
}
@@ -194,13 +201,12 @@
194201

195202

196203

197-
198204
if ( opts.classes )
199205
{
200206
opts.classes = opts.classes.join( ' ' );
201207
}
202208

203-
_iframe.updateMenu( opts );
209+
_iframe.updateMenu( opts, extr );
204210
$code.html( '// Your JS: \n$("#menu").mmenu(' + JSON.stringify( opts, null, 4 ) + ');' );
205211
}
206212

@@ -289,6 +295,10 @@ <h4>Extensions</h4>
289295
<!-- TODO: fullscreen -->
290296
<!-- TODO: iconbar -->
291297

298+
<li>
299+
<span>Always show an icon-bar</span>
300+
<input name="iconbar" type="checkbox" class="Toggle" />
301+
</li>
292302
<li id="ext_position">
293303
<span>Change the position of the menu?.</span>
294304
<ul>

src/js/addons/jquery.mmenu.offcanvas.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
function()
100100
{
101101
that._openFinish();
102-
}, 25
102+
}, this.conf.openingInterval
103103
);
104104

105105
return 'open';

src/js/addons/jquery.mmenu.searchfield.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,11 @@
200200

201201
// Update parent for submenus
202202
$( $panels.get().reverse() ).each(
203-
function()
203+
function( i )
204204
{
205205
var $t = $(this),
206206
$p = $t.data( _d.parent );
207-
207+
208208
if ( $p )
209209
{
210210
var $i = $t.add( $t.find( '> .' + _c.list ) ).find( '> li' )
@@ -222,9 +222,15 @@
222222
}
223223
else if ( opts.addTo == 'menu' )
224224
{
225-
if ( $t.hasClass( _c.current ) )
225+
if ( $t.hasClass( _c.opened ) )
226226
{
227-
$p.trigger( _e.open );
227+
// Compensate the timeout for the opening animation
228+
setTimeout(
229+
function()
230+
{
231+
$p.trigger( _e.open );
232+
}, ( i + 1 ) * ( that.conf.openingInterval * 1.5 )
233+
);
228234
}
229235
$p.addClass( _c.nosubresults );
230236
}
@@ -234,7 +240,7 @@
234240

235241
// Show/hide no results message
236242
$panel[ $items.not( '.' + _c.hidden ).length ? 'removeClass' : 'addClass' ]( _c.noresults );
237-
243+
238244
// Update for other addons
239245
that._update();
240246
}

src/js/addons/jquery.mmenu.searchfield.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)