aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2014-01-08 18:15:04 +0100
committerJörn Zaefferer <joern.zaefferer@gmail.com>2014-01-08 18:15:04 +0100
commit247257ebc9678fba708fc8f3f6835a95afaf2074 (patch)
treeabe7fb2f1a9c2dd61bc40490358d771e98e7eac5
parent0a012001381fbf6b963def7260cfb5b2871de35e (diff)
downloadjquery-ui-247257ebc9678fba708fc8f3f6835a95afaf2074.tar.gz
jquery-ui-247257ebc9678fba708fc8f3f6835a95afaf2074.zip
Menu: Fix var declaration and move regex comment to the right place.
Follow-up to a6806ab1
-rw-r--r--ui/jquery.ui.menu.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js
index f524c448f..8c9f5a9be 100644
--- a/ui/jquery.ui.menu.js
+++ b/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() );
},