Skip to content
Permalink
Browse files

Menu: Fix var declaration and move regex comment to the right place.

Follow-up to a6806ab
  • Loading branch information...
jzaefferer committed Jan 8, 2014
1 parent 0a01200 commit 247257ebc9678fba708fc8f3f6835a95afaf2074
Showing with 5 additions and 4 deletions.
  1. +5 −4 ui/jquery.ui.menu.js
@@ -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 );

@@ -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" );
}
@@ -497,6 +496,8 @@ $.widget( "ui.menu", {
},

_isDivider: function( item ) {

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

0 comments on commit 247257e

Please sign in to comment.
You can’t perform that action at this time.