Skip to content

Commit 247257e

Browse files
committed
Menu: Fix var declaration and move regex comment to the right place.
Follow-up to a6806ab
1 parent 0a01200 commit 247257e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ui/jquery.ui.menu.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,10 @@ $.widget( "ui.menu", {
274274
},
275275

276276
refresh: function() {
277-
var that = this,
277+
var menus, items,
278+
that = this,
278279
icon = this.options.icons.submenu,
279-
submenus = this.element.find( this.options.menus ),
280-
menus, items;
280+
submenus = this.element.find( this.options.menus );
281281

282282
this.element.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length );
283283

@@ -309,7 +309,6 @@ $.widget( "ui.menu", {
309309
// Initialize menu-items containing spaces and/or dashes only as dividers
310310
items.not( ".ui-menu-item" ).each(function() {
311311
var item = $( this );
312-
// hyphen, em dash, en dash
313312
if ( that._isDivider( item ) ) {
314313
item.addClass( "ui-widget-content ui-menu-divider" );
315314
}
@@ -497,6 +496,8 @@ $.widget( "ui.menu", {
497496
},
498497

499498
_isDivider: function( item ) {
499+
500+
// Match hyphen, em dash, en dash
500501
return !/[^\-\u2014\u2013\s]/.test( item.text() );
501502
},
502503

0 commit comments

Comments
 (0)