Skip to content

Commit

Permalink
Menu: Fix var declaration and move regex comment to the right place.
Browse files Browse the repository at this point in the history
Follow-up to a6806ab
  • Loading branch information
jzaefferer committed Jan 8, 2014
1 parent 0a01200 commit 247257e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ui/jquery.ui.menu.js
Expand Up @@ -274,10 +274,10 @@ $.widget( "ui.menu", {
},

refresh: function() {
var that = this,
var menus, items,
that = this,
icon = this.options.icons.submenu,
submenus = this.element.find( this.options.menus ),
menus, items;
submenus = this.element.find( this.options.menus );

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

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

_isDivider: function( item ) {

// Match hyphen, em dash, en dash
return !/[^\-\u2014\u2013\s]/.test( item.text() );
},

Expand Down

0 comments on commit 247257e

Please sign in to comment.